#include <bits/stdc++.h>
using namespace std;
int n, primes[100005], p, a, mx, f = 1;
map<int, int> m;
void modiSieve() {
  for (int i = 2; i <= 100001; ++i) {
    if (!primes[i]) {
      for (int j = i; j < 100001; j += i) {
        primes[j] = i;
      }
    }
  }
}
void divisors(int x) {
  p = primes[x];
  m[primes[x]]++;
  while (x / primes[x] != 1) {
    x /= primes[x];
    if (p == primes[x]) continue;
    p = primes[x];
    m[primes[x]]++;
  }
}
int main() {
  modiSieve();
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a);
    if (a != 1)
      divisors(a);
    else if (a == 1 && f)
      m[1]++, f = 0;
  }
  for (auto k : m)
    if (k.second > mx) mx = k.second;
  printf("%d\n", mx);
}
