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.io.*;
import java.util.*;
import java.util.function.Function;

public class Main {

    static int N;
    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        A = sc.nextIntArray(N);

        System.out.println(solve());
    }

    static int solve() {
        int one = 0;
        int g = -1;
        for (int i = 0; i < N; i++) {
            if( A[i] == 1 ) {
                one++;
            } else {
                if( g == -1 ) {
                    g = A[i];
                } else {
                    g = gcd(A[i], g);
                }
            }
        }

        if( one > 0 ) {
            if( one == N ) return -1;

            // 1, 2, 4 -> 2, 4
            if( g > 1 ) return one;
        }

        int[] osak = sieveOsak(15_000_000);
        int[] cnt = new int[15_000_000 + 1];
        for (int i = 0; i < N; i++) {
            if( A[i] == 1 ) continue;

            int[] factors = enumUniqFactors_osak(A[i]/g, osak);
            for (int p : factors) {
                if (p == 0) {
                    break;
                } else {
                    cnt[p]++;
                }
            }
        }

        int max = 0;
        for (int c : cnt) {
            max = Math.max(c, max);
        }
        return max == 0 ? -1 : N - max;
    }

    static int gcd(int a, int b) {
        while (b > 0) {
            int c = a;
            a = b;
            b = c % b;
        }
        return a;
    }

    static void inc(Map<Integer, Integer> cnt, int key) {
        if( cnt.containsKey(key) ) {
            cnt.put(key, cnt.get(key) + 1);
        } else {
            cnt.put(key, 1);
        }
    }

    static int[] sieveOsak(int n) {
        int[] sieve = new int[n+1];
        sieve[0] = -1; // dont use
        sieve[1] = 1; // goal

        int root = (int)Math.sqrt(n);
        for (int i = 2; i <= root; i++) {
            if( sieve[i] == 0 ) {
                sieve[i] = i;
                for (int d = 2; d*i <= n; d++) {
                    sieve[i*d] = i;
                }
            }
        }
        for (int i = root+1; i < n+1; i++) {
            if( sieve[i] == 0 ) {
                sieve[i] = i;
            }
        }
        return sieve;
    }

    static int[] enumUniqFactors_osak(int n, int[] osak) {
        // 6: 2 * 3 * 5 * 7 * 11 * 13 = 30030
        // 7: 2 * 3 * 5 * 7 * 11 * 13 * 17 = 510510
        // 8: 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 = 9699690
        int[] fs = new int[8];
        int i = -1;
        while( n != 1 ) {
            int factor = osak[n];
            if( i == -1 || factor != fs[i] ) {
                fs[++i] = factor;
            }
            n /= factor;
        }
        return fs;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        int[] nextIntArray(int n, int delta) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt() + delta;
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static <A> void writeLines(A[] as, Function<A, String> f) {
        PrintWriter pw = new PrintWriter(System.out);
        for (A a : as) {
            pw.println(f.apply(a));
        }
        pw.flush();
    }

    static void writeLines(int[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (int a : as) pw.println(a);
        pw.flush();
    }

    static void writeLines(long[] as) {
        PrintWriter pw = new PrintWriter(System.out);
        for (long a : as) pw.println(a);
        pw.flush();
    }

    static int max(int... as) {
        int max = Integer.MIN_VALUE;
        for (int a : as) max = Math.max(a, max);
        return max;
    }

    static int min(int... as) {
        int min = Integer.MAX_VALUE;
        for (int a : as) min = Math.min(a, min);
        return min;
    }

    static void debug(Object... args) {
        StringJoiner j = new StringJoiner(" ");
        for (Object arg : args) {
            if (arg instanceof int[]) j.add(Arrays.toString((int[]) arg));
            else if (arg instanceof long[]) j.add(Arrays.toString((long[]) arg));
            else if (arg instanceof double[]) j.add(Arrays.toString((double[]) arg));
            else if (arg instanceof Object[]) j.add(Arrays.toString((Object[]) arg));
            else j.add(arg.toString());
        }
        System.err.println(j.toString());
    }
}
