#include <bits/stdc++.h>
using namespace std;
int n, a[100010], maxn, ans, pri[100010], p[100010], cnt, has[100010];
template <typename T>
void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]), ++has[a[i]], chkmax(maxn, a[i]);
  ans = 1;
  for (int i = 2; i <= maxn; ++i) {
    if (!p[i]) p[i] = i, pri[++cnt] = i;
    for (int j = 1; j <= cnt && pri[j] <= p[i] && pri[j] * i <= maxn; ++j)
      p[pri[j] * i] = pri[j];
  }
  for (int i = 1; i <= cnt; ++i) {
    int cur = pri[i];
    int tmp = 0;
    for (int j = 1; j * cur <= maxn; ++j) tmp += has[j * cur];
    chkmax(ans, tmp);
  }
  printf("%d\n", ans);
  return 0;
}
