#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> m;
int n, a, ma = 1;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    int b = sqrt(a);
    for (int j = 2; j <= b; j++) {
      if (a % j == 0) {
        m[j]++;
      }
      while (a % j == 0) a /= j;
    }
    if (a > 1) m[a]++;
  }
  unordered_map<int, int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) {
    ma = max(ma, it->second);
  }
  cout << ma;
  return 0;
}
