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.
//package CFSEPT21;

import java.io.*;
import java.util.*;

public class Q3 {

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }

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

        public char nextChar() {
            return next().charAt(0);
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int[] nextIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextInt();
            }
            return arr;
        }

        public Integer[] nextIntegerArr(int n) {
            Integer[] arr = new Integer[n];
            for (int i = 0; i < n; i++) {
                arr[i] = new Integer(this.nextInt());
            }
            return arr;
        }

        public int[][] next2DIntArr(int n, int m) {
            int[][] arr = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    arr[i][j] = this.nextInt();
                }
            }
            return arr;
        }

        public int[] nextSortedIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextInt();
            }
            Arrays.sort(arr);
            return arr;
        }

        public long[] nextLongArr(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextLong();
            }
            return arr;
        }

        public char[] nextCharArr(int n) {
            char[] arr = new char[n];
            for (int i = 0; i < n; i++) {
                arr[i] = this.nextChar();
            }
            return arr;
        }
    }

    static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

//    static int[] uwiSieve(int n) {
//        if (n <= 32) {
//            int[] primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
//            for (int i = 0; i < primes.length; i++) {
//                if (n < primes[i]) {
//                    return Arrays.copyOf(primes, i);
//                }
//            }
//            return primes;
//        }
//
//        int u = n + 32;
//        double lu = Math.log(u);
//        int[] ret = new int[(int) (u / lu + u / lu / lu * 1.5)];
//        ret[0] = 2;
//        int pos = 1;
//
//        int[] isp = new int[(n + 1) / 32 / 2 + 1];
//        int sup = (n + 1) / 32 / 2 + 1;
//
//        int[] tprimes = {3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
//        for (int tp : tprimes) {
//            ret[pos++] = tp;
//            int[] ptn = new int[tp];
//            for (int i = (tp - 3) / 2; i < tp << 5; i += tp)
//                ptn[i >> 5] |= 1 << (i & 31);
//            for (int i = 0; i < tp; i++) {
//                for (int j = i; j < sup; j += tp)
//                    isp[j] |= ptn[i];
//            }
//        }
//
//        // 3,5,7
//        // 2x+3=n
//        int[] magic = {0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13, 31, 22, 28, 18, 26, 10, 7, 12, 21, 17,
//                9, 6, 16, 5, 15, 14};
//        int h = n / 2;
//        for (int i = 0; i < sup; i++) {
//            for (int j = ~isp[i]; j != 0; j &= j - 1) {
//                int pp = i << 5 | magic[(j & -j) * 0x076be629 >>> 27];
//                int p = 2 * pp + 3;
//                if (p > n)
//                    break;
//                ret[pos++] = p;
//                for (int q = pp; q <= h; q += p)
//                    isp[q >> 5] |= 1 << (q & 31);
//            }
//        }
//
//        return Arrays.copyOf(ret, pos);
//    }

    static int[] sieve(int n){

        int temp[]=new int[n];

        int s=0;
        for(int i=2;i<n;i++){
            if(temp[i]==0) {
                s++;
                for (int j = i + i; j < n; j += i)
                    temp[j]=temp[j]+1;
            }
        }

        int []ans=new int[s];

        int p=0;
        for (int i=2;i<n;i++){
            if(temp[i]==0) {

                ans[p] = i;
                p++;
            }
        }



        return ans;
    }

    public static void main(String[] args) {

        InputReader in = new InputReader();
        int N = in.nextInt(),input[] = new int[N];

        int nax = (int) 1.5e7 + 1, frq[] = new int[nax], g = 0;

        for (int i = 0; i < N; i++) {
            input[i] = in.nextInt();
            g = gcd(g, input[i]);
            frq[input[i]]++;
        }

        if (frq[g] == N) {
            System.out.println(-1);
            return;
        }


        int prime[] = sieve(nax),x=0;

//        System.out.println(prime.length);
//        for (int i = 0; i < prime.length; i++) {
//
//            System.out.print(prime[i]+" ");
//        }
            for (int i = 0; i < prime.length; i++) {

        //    System.out.println(i);
            long test=prime[i]*g;

            int y=0;
            for(long j=test;j<frq.length;j+=test){
                y+=frq[(int)j];
            }

            x=Math.max(x,y);
        }
       // System.out.println(x);


        System.out.println(N-x);


    }


}


//        HashMap<Integer,Integer> map=new HashMap<>();
//        if(map.containsKey(input[i]))
//            map.put(input[i],map.get(input[i])+1);
//        else
//            map.put(input[i],1);
//
//        for(Map.Entry<Integer,Integer> Test: map.entrySet()){
//            int Key=Test.getKey();
//            int val=Test.getValue();
//        }
