#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
int arr[100000] = {0};
vector<int> factors(100000, 0);
void seive(int n) {
  for (int i = 2; i <= n; i++) {
    for (int j = i * i; j <= n && j > 0; j += i) {
      arr[j - 1] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (arr[i - 1] == 0)
      if (i != 1) primes.push_back(i);
  }
}
void primeFactors(int N) {
  if (!primes.size()) return;
  int PF_idx = 0, PF = primes[PF_idx];
  while (N != 1 && (PF * PF <= N) && PF_idx < primes.size()) {
    if (N % PF == 0) factors[PF]++;
    while (N % PF == 0) {
      N /= PF;
    }
    PF = primes[++PF_idx];
  }
  if (N != 1) factors[N]++;
}
int main() {
  int n;
  cin >> n;
  if (n == 1)
    cout << 1 << endl;
  else {
    vector<int> num(n);
    for (int i = 0; i < n; i++) cin >> num[i];
    int maxi = *max_element(num.begin(), num.end());
    seive(maxi);
    for (int i = 0; i < n; i++) {
      primeFactors(num[i]);
    }
    maxi = *max_element(factors.begin(), factors.end());
    if (!maxi)
      cout << 1 << endl;
    else
      cout << maxi << endl;
  }
}
