Mr. F has n positive integers, a_1, a_2, …, a_n.

He thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers.

But this problem is too simple for him, so he does not want to do it by himself. If you help him, he will give you some scores in reward.

Your task is to calculate the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers.

Input

The first line contains an integer n (2 ≤ n ≤ 3 ⋅ 10^5) — the number of integers Mr. F has.

The second line contains n integers, a_1, a_2, …, a_n (1 ≤ a_i ≤ 1.5 ⋅ 10^7).

Output

Print an integer — the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers.

You should not remove all of the integers.

If there is no solution, print «-1» (without quotes).

Examples

Input

3
1 2 4


Output

1

Input

4
6 9 15 30


Output

2

Input

3
1 1 1


Output

-1

Note

In the first example, the greatest common divisor is 1 in the beginning. You can remove 1 so that the greatest common divisor is enlarged to 2. The answer is 1.

In the second example, the greatest common divisor is 3 in the beginning. You can remove 6 and 9 so that the greatest common divisor is enlarged to 15. There is no solution which removes only one integer. So the answer is 2.

In the third example, there is no solution to enlarge the greatest common divisor. So the answer is -1.
import java.util.*;
import java.util.stream.*;
import java.util.function.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
import static java.util.Comparator.*;
import static java.lang.Math.*;
public class Main {
  public static final PrintWriter outWriter = new PrintWriter(System.out);
  public static final int _BUFFER_SIZE = 1 << 16;
  public static final DataInputStream _din = new DataInputStream(System.in);
  public static final byte[] _buffer = new byte[_BUFFER_SIZE];
  public static int _bufferPointer = 0, _bytesRead = 0;
  public static int gcd(int a, int b) {
    while (b > 0) {
      int tmp = b;
      b = a%b;
      a = tmp;
    }
    return a;
  }
  public static int[] firstFactors = null;
  public static class Res {
    public int power;
    public int count;
    public int power() { return power; }
    public int count() { return count; }
    Res(int power, int count) { this.power=power; this.count=count; }
    Res() {
      this(nextInt(),nextInt());
    }
    public boolean equals(Object oo) {
      @SuppressWarnings("unchecked")
      Res o = (Res)oo;
      return o != null && power==o.power&&count==o.count;
    }
    public int hashCode() { return Objects.hash(power,count); }
    public String toString() { return ""+power+","+count; }
  }
  public static int getFactor(int l) {
    return l >= firstFactors.length || firstFactors[l] == 0 ? l : firstFactors[l];
  }
  public static void fillSieve(int upTo) {
    firstFactors = new int[upTo+1];
    int sieveMax = Math.min(firstFactors.length, (int)(Math.sqrt(upTo)+5));
    for (int i = 2; i < sieveMax; i++) {
      if (firstFactors[i] == 0) {
        for (int j = i+i; j < firstFactors.length; j+=i) {
          firstFactors[j] = i;
        }
      }
    }
  }
  public static void main() {
    HashMap<Integer,Integer> counts = new HashMap<Integer,Integer>();
    int n = nextInt();
    int[] as = new int[n];
    for (int i = 0; i < as.length; i++) {
      as[i] = nextInt();
    }
    int g = as[0], max = as[0];
    for (int i = 1; i < n; i++) {
      g = gcd(g, as[i]);
      max = Math.max(max, as[i]);
    }
    fillSieve(max/g);
    for (int i = 0; i < n; i++) {
      int a = as[i] / g;
      while (a > 1) {
        int factor = getFactor(a);
        counts.merge(factor, 1, Integer::sum);
        while (a % factor == 0) {
          a /= factor;
        }
      }
    }
    int out = Integer.MIN_VALUE;
    for (Integer e : counts.values()) {
      out = Math.max(out,e);
    }
    outWriter.println(out == Integer.MIN_VALUE ? -1 : n-out);
  }
  public static void main(String[] args) { main(); outWriter.flush(); }
  public static void _fillBuffer() {
    try {
      _bytesRead = _din.read(_buffer, _bufferPointer = 0, _buffer.length);
      if (_bytesRead == -1) {
        _bytesRead = 1;
        _buffer[0] = '\n';
      }
    } catch (IOException e) {
      System.err.println("B");
      throw new UncheckedIOException(e);
    }
  }
  public static byte _read() {
    if (_bufferPointer == _bytesRead)
      _fillBuffer();
    return _buffer[_bufferPointer++];
  }
  public static String next() {
    byte[] strBuf = new byte[64];
    int cnt = 0, c;
    while ((c = _read()) != -1) {
      if (Character.isWhitespace(c)) {
        if (cnt == 0) {
          continue;
        } else {
          break;
        }
      }
      if (strBuf.length == cnt) {
        strBuf = Arrays.copyOf(strBuf, strBuf.length*2);
      }
      strBuf[cnt++] = (byte) c;
    }
    return new String(strBuf, 0, cnt);
  }
  public static String nextLine() {
    byte[] strBuf = new byte[64];
    int cnt = 0, c;
    while ((c = _read()) != -1) {
      if (c == '\n') {
        if (cnt == 0) {
          continue;
        } else {
          break;
        }
      }
      if (strBuf.length == cnt) {
        strBuf = Arrays.copyOf(strBuf, strBuf.length*2);
      }
      strBuf[cnt++] = (byte) c;
    }
    return new String(strBuf, 0, cnt);
  }
  public static int nextInt() {
    int ret = 0;
    byte c = _read();
    while (c <= ' ')
      c = _read();
    boolean neg = (c == '-');
    if (neg)
      c = _read();
    do {
      ret = ret * 10 + c - '0';
    } while ((c = _read()) >= '0' && c <= '9');
    if (neg)
      return -ret;
    return ret;
  }
  public static long nextLong() {
    long ret = 0;
    byte c = _read();
    while (c <= ' ')
      c = _read();
    boolean neg = (c == '-');
    if (neg)
      c = _read();
    do {
      ret = ret * 10 + c - '0';
    } while ((c = _read()) >= '0' && c <= '9');
    if (neg)
      return -ret;
    return ret;
  }
  public static double nextDouble() {
    double ret = 0, div = 1;
    byte c = _read();
    while (c <= ' ')
      c = _read();
    boolean neg = (c == '-');
    if (neg)
      c = _read();
    do {
      ret = ret * 10 + c - '0';
    }
    while ((c = _read()) >= '0' && c <= '9');
    if (c == '.') {
      while ((c = _read()) >= '0' && c <= '9') {
        ret += (c - '0') / (div *= 10);
      }
    }
    if (neg)
      return -ret;
    return ret;
  }
}
