#include <bits/stdc++.h>
using namespace std;
bool nPrime[100005];
int cs[100005];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n = 0, m = 1;
  cin >> n;
  vector<int> primos;
  for (int i = 2; i * i < 100003; i++) {
    if (!nPrime[i]) {
      for (int j = 2; j * i < 100003; j++) {
        nPrime[i * j] = true;
      }
    }
  }
  for (int i = 2; i < 100001; i++)
    if (!nPrime[i]) primos.push_back(i);
  for (int i = 0; i < n; i++) {
    unsigned int t;
    cin >> t;
    cs[t]++;
  }
  for (size_t i = 0; i < primos.size(); i++) {
    int c = 0;
    int p = primos[i];
    for (int j = p; j < 100002; j += p) c += cs[j];
    m = max(m, c);
  }
  cout << m << endl;
  return 0;
}
