#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
long long int B[200010], A[200010], X[200010], Y[200010];
long long int n, m, p, q;
long long int powP(long long int a, long long int b) {
  if (b == 0) return 1 % mod;
  long long int k;
  k = powP(a, b / 2);
  k = k * k % mod;
  if (b % 2 == 0)
    return k;
  else
    return a * k % mod;
}
bool bitSet(long long int n, long long int i) {
  if ((n & (1LL << i)) != 0)
    return true;
  else
    return false;
}
int main() {
  long long int T, i, p, j, l, r, b, k, c, a, d, w, x, y, v, z, t, curr, prev,
      sum, ans, pos, val, countA, secondMin, indicator;
  a = 1e5 + 10;
  scanf("%lld", &n);
  for (long long int i = (1); i <= (n); ++i) {
    scanf("%lld", &j);
    B[j]++;
  }
  ans = 1;
  for (long long int i = (2); i <= (a - 1); ++i) A[i] = 1;
  for (long long int i = (2); i <= (a - 1); ++i) {
    if (A[i] == 1) {
      curr = 0;
      for (long long int j = i; j < a; j += i) {
        A[j] = 0;
        curr += B[j];
      }
      ans = max(ans, curr);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
