#include <bits/stdc++.h>
using namespace std;
vector<int> prime;
unordered_set<int> p;
bool isPrime(int n) {
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
void getPrime() {
  prime.push_back(2);
  p.insert(2);
  for (int i = 3; i < 100000; i += 2) {
    if (isPrime(i)) {
      prime.push_back(i);
      p.insert(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  getPrime();
  int n, res = 1, s;
  cin >> n;
  unordered_map<int, int> cnt;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (p.count(s)) {
      ++cnt[s];
      continue;
    }
    for (int j = 0; j < 75; ++j) {
      if (s < prime[j]) break;
      if (s % prime[j] == 0) {
        ++cnt[prime[j]];
        while (s % prime[j] == 0) s /= prime[j];
      }
    }
    if (s != 1) ++cnt[s];
  }
  for (auto &item : cnt) res = max(res, item.second);
  cout << res << endl;
  return 0;
}
