#include <bits/stdc++.h>
using namespace std;
constexpr int MAX = 100001;
int a[MAX];
bool b[MAX];
vector<int> p;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, r = 1, k;
  cin >> n;
  for (int i = 2; i * i < MAX; i++)
    if (!b[i]) {
      for (int j = i + i; j < MAX; j += i) b[j] = true;
      p.push_back(i);
    }
  for (int i = 0; i < n; i++) {
    cin >> k;
    for (int j = 0; j < p.size() && k > 1; j++)
      if (k % p[j] == 0) {
        a[p[j]]++;
        while (k % p[j] == 0) k /= p[j];
      }
    a[k]++;
  }
  for (int i = 2; i < MAX; i++)
    if (a[i] != 1) r = max(r, a[i]);
  cout << r << endl;
  return 0;
}
