#include <bits/stdc++.h>
using namespace std;
int n;
int a[200000], d[200000];
int process() {
  int MAX = -1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    d[a[i]]++;
    MAX = max(MAX, a[i]);
  }
  int res = 0;
  if (n > 0) res = 1;
  for (int i = 2; i <= MAX; i++) {
    int cnt = 0;
    int j = 0;
    while (j <= MAX) {
      cnt += d[j];
      j += i;
    }
    res = max(res, cnt);
  }
  cout << res;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  process();
  return 0;
}
