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