#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long w = 0, h = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') h = -h;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    w = w * 10 + ch - '0';
    ch = getchar();
  }
  return w * h;
}
long long n, a[100010], ans, p, t[100010];
bool vis[100010];
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) {
    a[i] = read();
    t[a[i]]++;
    if (a[i] == 1 && n == 1) return puts("1"), 0;
    if (a[i] == 1) i--, n--;
  }
  for (long long i = 2; i <= 100010; i++) {
    if (vis[i]) continue;
    p = t[i];
    for (long long j = 2; j * i <= 100010; j++) {
      vis[j * i] = 1;
      p += t[j * i];
    }
    ans = max(ans, p);
  }
  printf("%lld\n", ans);
  return 0;
}
