#include <bits/stdc++.h>
using namespace std;
int f[100005];
bool F[100005];
int b[100005], l = 0;
void fenjie(int k) {
  for (int i = 0; k != 1; i++) {
    if (k % b[i] == 0) {
      f[b[i]]++;
      while (k % b[i] == 0) k /= b[i];
    }
  }
}
int main() {
  memset(F, true, sizeof(F));
  F[0] = false;
  F[1] = false;
  for (int i = 2; i < 100005; i++) {
    if (F[i]) {
      b[l++] = i;
      for (int j = i * 2; j < 100005; j += i) F[j] = false;
    }
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    if (!F[k])
      fenjie(k);
    else
      f[k]++;
  }
  int ma = 1;
  for (int i = 2; i < 100005; i++) {
    ma = max(f[i], ma);
  }
  printf("%d\n", ma);
}
