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 math_codet;

import java.io.*;
import java.util.*;
 /******************************************
*    AUTHOR:         AMAN KUMAR SINGH        *
*    INSTITUITION:   KALYANI GOVERNMENT ENGINEERING COLLEGE  *
******************************************/
public class lets_do {
    InputReader in;
    PrintWriter out;
    Helper_class h;
    final long mod=1000000007;
    public static void main(String[] args) throws java.lang.Exception{
        new lets_do().run();
    }
    void run() throws Exception{
        in=new InputReader();
        out = new PrintWriter(System.out);
        h = new Helper_class();
        sieve();
        sieveOfEratosthenes2();
        int t = 1;
        while(t-->0)
            solve();
        out.flush();    
        out.close();
    }
    
    int MAX_Ai=15000005;
    boolean prime2[]=new boolean[MAX_Ai];
    int spf[] = new int[MAX_Ai];
    ArrayList<Integer> primes = new ArrayList<Integer>();
    void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAX_Ai; i++)
            spf[i] = i;
        for (int i=4; i<MAX_Ai; i+=2)
            spf[i] = 2;
        for (int i=3; i*i<MAX_Ai; i++)
        {
            if (spf[i] == i)
            {
                for (int j=i*i; j<MAX_Ai; j+=i){
                    if (spf[j]==j)
                        spf[j] = i;
                }
            }
        }
    }
    void sieveOfEratosthenes2(){
        for(int i=0;i<MAX_Ai;i++)
            prime2[i] = true;
        for(int p = 2; p*p <MAX_Ai; p++)
        {
            if(prime2[p] == true)
            {
                for(int i = p*2; i < MAX_Ai; i += p){
                    if(prime2[i]==true){
                        prime2[i] = false;
                    }
                }
            }
        }
        
    }
    TreeMap<Integer, Integer> tmap = new TreeMap<Integer, Integer>();
    void solve(){
        int n = h.ni();
        int[] arr = new int[n];
        int i = 0;
        int gcd = 0;
        for(i = 0; i < n; i++){
            arr[i] = h.ni();
            gcd = h.gcd(gcd, arr[i]);
        }
        for(i = 0; i < n; i++){
            arr[i] /= gcd;
        }
        int[] count = new int[MAX_Ai];
        for(i = 0; i < n; i++){
            int N = arr[i];
            int curr = spf[N];
            count[curr]++;
            while (N > 1)
            {
                N /= spf[N];
                if (curr == spf[N])
                    continue;
                curr = spf[N];
                count[curr]++;
            }
        }
        int max = 0;
        for(i = 2; i < MAX_Ai; i++){
            if(prime2[i])
                max = Math.max(count[i], max);
        }
        if(max == 0)
        	h.pn(-1);
        else
        	h.pn(n - max);
    }
    void add_map(int x){
        Integer xx = tmap.get(x);
        if(xx == null)
            tmap.put(x, 1);
        else
            tmap.put(x, ++x);
    }
    void remove_map(int x){
        Integer xx = tmap.get(x);
        if(xx == 1)
            tmap.remove(x);
        else
            tmap.put(x, --xx);
    }
    final Comparator<Entity> com=new Comparator<Entity>(){
        public int compare(Entity x, Entity y){
            int xx=Integer.compare(y.b, x.b);
            if(xx==0){
                int xxx=Integer.compare(x.a,y.a);
                return xxx;
            }
            else
                return xx;
        }
    };
    class Entity{
        int a;
        int b;
        Entity(int p, int q){
            a=p;
            b=q;
        }
    }
    class Helper_class{
        long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
        int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
        int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
        void p(Object o){out.print(o);}
        void pn(Object o){out.println(o);}
        void pni(Object o){out.println(o);out.flush();}
        String n(){return in.next();}
        String nln(){return in.nextLine();}
        int ni(){return Integer.parseInt(in.next());}
        long nl(){return Long.parseLong(in.next());}
        double nd(){return Double.parseDouble(in.next());}

        long mul(long a,long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            a*=b;
            if(a>=mod)a%=mod;
            return a;
        }
        long modPow(long a, long p){
            long o = 1;
            while(p>0){
                if((p&1)==1)o = mul(o,a);
                a = mul(a,a);
                p>>=1;
            }
            return o;
        }
        long add(long a, long b){
            if(a>=mod)a%=mod;
            if(b>=mod)b%=mod;
            if(b<0)b+=mod;
            a+=b;
            if(a>=mod)a-=mod;
            return a;
        }
    }

    class InputReader{
        BufferedReader br;
        StringTokenizer st;
        public InputReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public InputReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }
 
        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }   
            return str;
        }
    }
}       