#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, ans, f[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1, w; i <= n; ++i) {
    scanf("%d", &w);
    ++f[w];
  }
  ans = 1;
  for (int i = 2; i <= 100000; ++i) {
    for (int j = i + i; j <= 100000; j += i) f[i] += f[j];
    ans = max(ans, f[i]);
  }
  printf("%d\n", ans);
  return 0;
}
