#include <bits/stdc++.h>
using namespace std;
bool isprime[100005];
int n, cnt[100005], can[100005], maxs, ans = 1;
void Eratosthenes() {
  for (int i = 2; i <= maxs; i++) {
    if (isprime[i]) continue;
    can[i] += cnt[i];
    for (int j = 2; j <= maxs / i; j++) {
      isprime[i * j] = 1;
      can[i] += cnt[i * j];
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    cnt[a]++;
    maxs = max(maxs, a);
  }
  Eratosthenes();
  for (int i = 1; i <= maxs; i++) {
    ans = max(ans, can[i]);
  }
  cout << ans << endl;
  return 0;
}
