#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, -1, 0, 1, -1, -1, 1, 1};
const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int n;
vector<int> vec;
int main() {
  cin >> n;
  vec.resize(n);
  int ans = 0;
  for (int i = 0; i < n; i++) cin >> vec[i];
  vector<bool> primes(100000 + 5, 1);
  primes[0] = primes[1] = 0;
  for (long long i = 2; i * i <= 100002; i++) {
    if (primes[i]) {
      for (int j = i * 2; j <= 100002; j += i) primes[j] = 0;
    }
  }
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    if (primes[vec[i]]) {
      mp[vec[i]]++;
      continue;
    }
    for (long long k = 2; k * k <= vec[i]; k++) {
      if (vec[i] % k == 0) {
        if (primes[k]) mp[k]++;
        if (primes[vec[i] / k] && (k * k != vec[i])) mp[vec[i] / k]++;
      }
    }
  }
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
    ans = max(ans, it->second);
  }
  ans == 0 ? cout << 1 : cout << ans;
  return 0;
}
