#include <bits/stdc++.h>
using namespace std;
int was[1000001], n, x;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    for (int t = 2; t * t <= x; t++)
      if (x % t == 0) {
        was[t]++;
        while (x % t == 0 && x > 1) x /= t;
      }
    if (x > 1) was[x]++;
  }
  int ans = 1;
  for (int i = 2; i <= 100000; i++) ans = max(ans, was[i]);
  cout << ans;
  return 0;
}
