#include <bits/stdc++.h>
using namespace std;
vector<long long int> w;
map<long long int, long long int> u, v;
void Y() {
  cout << "YES"
       << "\n";
}
void N() {
  cout << "NO"
       << "\n";
}
void pp(long long int n) {
  long long int i, j;
  for (i = 2; i <= sqrt(n); i++) {
    if (u[i] == 0) {
      for (j = 2 * i; j <= n; j += i) {
        u[j] = i;
      }
    }
  }
  for (i = 1; i < n; i++) {
    if (u[i] == 0) {
      u[i] = i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, k, p, q, o, l, s, t, z = 0, r;
  string a, b, c;
  double x, y, d, e, f;
  pp(100000);
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> o;
    w.push_back(o);
  }
  k = 0;
  for (i = 0; i < n; i++) {
    o = w[i];
    while (o > 1) {
      l = u[o];
      ++v[l];
      k = max(k, v[l]);
      while (o % l == 0) {
        o /= l;
      }
    }
  }
  if (k == 0) {
    k = 1;
  }
  cout << k << "\n";
  return 0;
}
