#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n;
  unordered_map<int, int> facs;
  while (n--) {
    cin >> x;
    int sqx = sqrt(x);
    for (int i = 2; i <= sqx; i++) {
      if (x % i == 0) facs[i]++;
      while (x % i == 0) x /= i;
    }
    if (x > 1) facs[x]++;
  }
  int res = 1;
  for (auto A : facs) res = max(res, A.second);
  cout << res << endl;
}
