#include <bits/stdc++.h>
using namespace std;
int num[100010];
int pri[10000];
int pri_num[10001];
int main() {
  memset(num, -1, sizeof(num));
  int cnt = 0;
  num[0] = num[1] = 0;
  for (int i = 2; i < 100001; ++i) {
    if (num[i] == -1) {
      pri[cnt++] = i;
      num[i] = 1;
      for (int j = i + i; j < 100001; j += i) {
        num[j] = 0;
      }
    }
  }
  int n, temp, half, pos;
  cin >> n;
  memset(pri_num, 0, sizeof(pri_num));
  if (n == 1) {
    cout << "1" << endl;
    return 0;
  }
  while (n--) {
    cin >> temp;
    if (num[temp] == 1) {
      pos = lower_bound(pri, pri + 9592, temp) - pri;
      ++pri_num[pos];
      continue;
    }
    for (int i = 0; i < 9592; ++i) {
      if (pri[i] > temp) break;
      if (!(temp % pri[i])) {
        ++pri_num[i];
        temp /= pri[i];
      }
    }
  }
  int mmax = -1;
  for (int i = 0; i < 9592; ++i) {
    mmax = mmax > pri_num[i] ? mmax : pri_num[i];
  }
  if (mmax)
    cout << mmax << endl;
  else
    cout << "1" << endl;
  return 0;
}
