#include <bits/stdc++.h>
using namespace std;
const int k_max_n = 1e5 + 11, k_max_s = 1e5 + 11;
int n;
int ss[k_max_n], cnt[k_max_s];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &ss[i]);
  }
  for (int i = 0; i < n; ++i) {
    int sqrtn = sqrt(ss[i]);
    for (int j = 1; j <= sqrtn; ++j) {
      if (ss[i] % j == 0) {
        cnt[j]++;
        if (j != ss[i] / j) cnt[ss[i] / j]++;
      }
    }
  }
  int ans = 1;
  for (int i = 2; i < k_max_s; ++i) ans = max(ans, cnt[i]);
  printf("%d\n", ans);
  return 0;
}
