#include <bits/stdc++.h>
using namespace std;
const long long N = 100009;
long long ar[N];
int main() {
  long long i, n, c, x, ans, j;
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> x;
      ar[x]++;
    }
    ans = 1;
    for (i = 2; i <= N; i++) {
      c = 0;
      for (j = i; j <= N; j += i) c += ar[j];
      ans = max(ans, c);
    }
    cout << ans << endl;
  }
  return 0;
}
