#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstdlib>
#include <string>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define f first
#define s second
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define eb emplace_back
#define in insert
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define FOR(i, n, x) for(int i = x; i < n; i++)
#define OUT(a, e) FOR(i, e, 0) cout << a[i] << ' '
#define OUTV(a) for(auto i : a) cout << i << ' ';
#define maxim(a, n, mx) FOR(i, n, x)mx = max(mx, a[i]);

using namespace std;
vector<ll> pr;

int main()
{
    int up = 1e8;
    vector<char> prime (up+1, true);
    prime[0] = prime[1] = false;
    for (int i=2; i<=up; ++i)
        if (prime[i])
        {
            pr.pb(i);
            if (i * 1ll * i <= up)
                for (int j=i*i; j<=up; j+=i)
                    prime[j] = false;
        }
    int n; cin >> n;
    ll a[n], gc = 0;
    FOR(i, n, 0)
    {
        cin >> a[i];
        gc = __gcd(gc, a[i]);
    }
    if(gc != 1)
    {
        cout << n << endl;
        return 0;
    }
    FOR(i, n, 0)a[i] = a[i] / gc;
    int cnt = 0, ans = 0;
    for(auto el : pr)
    {
        cnt = 0;
        FOR(i, n, 0)
        {
            if(a[i] % el == 0)cnt++;
        }
        ans = max(ans, cnt);
    }
    cout << ans;
	return 0;
}
/*
3 1000000000000000000 1000000000000000000 1000000000000000000
*/
