#include <bits/stdc++.h>
using namespace std;
vector<long long int> fac[100010];
long long int isp[100010];
long long int cnt[100010];
int main() {
  for (long long int i = 2; i <= 100000; i++) {
    if (isp[i]) continue;
    isp[i] = i;
    for (long long int j = i * i; j <= 100000; j += i) {
      isp[j] = i;
    }
  }
  int n, z;
  long long int mx = 1;
  cin >> n;
  z = n;
  while (n--) {
    long long int x, keep;
    cin >> x;
    while (x > 1) {
      mx = max(mx, ++cnt[isp[x]]);
      keep = isp[x];
      while (x % keep == 0) x /= keep;
    }
  }
  cout << mx << endl;
}
