#include <bits/stdc++.h>
using namespace std;
int ALL[100005];
int sq = sqrt(100005), sz;
vector<int> primes;
void sieve() {
  for (int i = 3; i <= sq; i += 2) {
    if (ALL[i] != 1) {
      for (int j = i * i; j < 100005; j += i * 2) {
        ALL[j] = 1;
      }
    }
  }
}
void store() {
  primes.push_back(2);
  for (int i = 3; i < 100005; i += 2) {
    if (ALL[i] == 0) {
      primes.push_back(i);
    }
  }
  sz = primes.size();
}
map<int, int> factors;
void factorize(int num) {
  int flag = 0;
  for (int i = 0; primes[i] < sqrt(num) + 1; ++i) {
    while (num % primes[i] == 0) {
      num = num / primes[i];
      if (flag == 0) {
        ++factors[primes[i]];
        flag = 1;
      }
    }
    flag = 0;
  }
  if (num > 1) {
    ++factors[num];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  sieve();
  store();
  int n, num;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> num;
    factorize(num);
  }
  map<int, int>::iterator it;
  int mx = 1;
  for (it = factors.begin(); it != factors.end(); ++it) {
    if (it->second > mx) mx = it->second;
  }
  cout << mx << endl;
  return 0;
}
