#include <bits/stdc++.h>
using namespace std;
vector<int> sf(100005, 0);
void solve() {
  sf[1] = 1;
  for (int i = 2; i < 100005; i++) {
    if (sf[i] == 0) {
      sf[i] = i;
      for (int j = i * 2; j < 100005; j += i) {
        if (sf[j] == 0) sf[j] = i;
      }
    }
  }
  int n;
  cin >> n;
  vector<int> A(n), cnt(100005, 0);
  for (auto& i : A) cin >> i;
  for (int i = 0; i < n; i++) {
    int lst = 0;
    do {
      if (sf[A[i]] != lst) cnt[sf[A[i]]]++;
      lst = sf[A[i]];
      A[i] /= sf[A[i]];
    } while (sf[A[i]] != 1);
  }
  cnt[1] = 1;
  int mx = *max_element(cnt.begin(), cnt.end());
  cout << mx;
}
void trials() {
  int t;
  for (cin >> t; t--; cout << endl) {
    solve();
  }
}
int main() { solve(); }
