#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a[100010];
int b[100010], c[100010];
bool bb[100010];
vector<int> prime;
inline void get_ready() {
  for (int i = (2); i <= (100000); i++) {
    if (!bb[i]) {
      prime.push_back(i);
      for (int j = i; j <= 100000; j += i) a[i].push_back(j), bb[j] = 1;
    }
  }
  scanf("%d", &n);
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &b[i]);
    c[b[i]]++;
  }
}
inline int calc(int x) {
  int y = 0;
  for (int i = 0; i < a[x].size(); i++) y += c[a[x][i]];
  return y;
}
inline void solve() {
  int ans = 1;
  for (int i = (0); i <= (prime.size() - 1); i++) {
    int now = calc(prime[i]);
    ans = max(ans, now);
  }
  cout << ans << endl;
}
int main() {
  get_ready();
  solve();
  return 0;
}
