#include <bits/stdc++.h>
using namespace std;
int pr[100006] = {0};
void sieve() {
  pr[1] = 1;
  for (int i = 2; i < 1000; i++) {
    if (pr[i]) continue;
    for (int j = 2 * i; j < 100005; j += i) pr[j] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  sieve();
  int n, el, arr[100005] = {0}, j = 0, ans = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> el, arr[el]++;
  for (int i = 2; i < 100005; i++) {
    if (pr[i]) continue;
    int temp = 0;
    for (int j = i; j < 100005; j += i) temp += arr[j];
    ans = max(ans, temp);
  }
  cout << ans;
}
