#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> m;
  int i, j, maxa, temp, n;
  cin >> n;
  m[1]++;
  while (n--) {
    cin >> temp;
    for (i = 2; i <= sqrt(temp); i++) {
      if (temp % i == 0) {
        m[i]++;
        while (temp % i == 0) temp /= i;
      }
    }
    if (temp != 1) m[temp]++;
  }
  maxa = INT_MIN;
  for (auto it = m.begin(); it != m.end(); it++) maxa = max(maxa, it->second);
  cout << maxa << endl;
  return 0;
}
