#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
long long arr[N] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long p;
    cin >> p;
    for (int i = 2; i * i <= p; i++) {
      if (p % i == 0) {
        arr[i]++;
        while (p % i == 0) p /= i;
      }
    }
    if (p > 1) arr[p]++;
  }
  long long res = 1;
  for (long long j = 2; j <= N + 2; j++) res = max(res, arr[j]);
  cout << res << "\n";
  return 0;
}
