#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int lp[MAXN];
vector<int> pr;
int ans[MAXN];
int main() {
  for (int i = 2; i < MAXN; ++i) {
    ans[i] = 0;
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && i * pr[j] < MAXN;
         ++j)
      lp[i * pr[j]] = pr[j];
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int s;
    cin >> s;
    while (s > 1) {
      int d = lp[s];
      ans[d]++;
      while (s % d == 0) {
        s /= d;
      }
    }
  }
  int res = 0;
  for (int i = 2; i < MAXN; i++) {
    res = (res > ans[i] ? res : ans[i]);
  }
  cout << (res > 1 ? res : 1);
  return 0;
}
