#include <bits/stdc++.h>
using namespace std;
long long a[100003], cnt[100003], p[100003];
vector<int> primes;
void seive() {
  p[1] = 1;
  for (int i = 2; i < 100003; i++) {
    if (!p[i]) {
      primes.push_back(i);
      for (int j = 2 * i; j < 100003; j += i) p[j] = i;
    }
  }
  for (int i = 2; i < 100003; i++)
    if (!p[i]) p[i] = i;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, x, y;
  seive();
  long long ans = 1;
  cin >> n;
  for (int i = 1; i < n + 1; i++) {
    cin >> y;
    while (p[y] != y) {
      int div = p[y];
      cnt[div]++;
      while (y % div == 0) y /= div;
    }
    if (y != 1) cnt[y]++;
  }
  for (auto i : primes) ans = max(ans, cnt[i]);
  cout << ans;
  return 0;
}
