#include <bits/stdc++.h>
using namespace std;
vector<int> primes[112345];
void sive() {
  for (int i = 2; i <= 100000; i++) {
    if (!primes[i].empty()) continue;
    for (int j = i; j <= 100000; j += i) primes[j].push_back(i);
  }
}
int main() {
  sive();
  int n;
  scanf("%d", &n);
  map<int, int> mp;
  int mx = 1;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 0; j < primes[x].size(); j++) {
      mp[primes[x][j]]++;
      mx = max(mx, mp[primes[x][j]]);
    }
  }
  cout << mx;
}
