#include <bits/stdc++.h>
using namespace std;
map<int, int> gcdrep;
vector<int> primeList;
int main() {
  for (__typeof(2) i = 2; i < 100005; i += 1) {
    bool isPrime = true;
    for (__typeof(primeList.begin()) it = primeList.begin();
         it != primeList.end(); ++it) {
      if (i % *it == 0) isPrime = false;
      if (isPrime == false || *it * *it > i) break;
    }
    if (isPrime) primeList.push_back(i);
  }
  int n;
  cin >> n;
  for (__typeof(0) i = 0; i < n; i += 1) {
    int str;
    cin >> str;
    for (__typeof(primeList.begin()) it = primeList.begin();
         it != primeList.end(); ++it) {
      if (str == 1) break;
      if (*it * *it > str) {
        gcdrep[str]++;
        break;
      }
      if (str % *it == 0) {
        gcdrep[*it]++;
        while (str % *it == 0) str /= *it;
      }
    }
  }
  int ans = 1;
  for (__typeof(gcdrep.begin()) it = gcdrep.begin(); it != gcdrep.end(); ++it) {
    ans = max(ans, it->second);
  }
  cout << ans << endl;
}
