#include <bits/stdc++.h>
using namespace std;
void WritePrime(bool* P, int n) {
  P[0] = P[1] = 1;
  for (int i = 2; i * i < n; i++)
    if (!P[i])
      for (int j = i * i; j < n; j += i) P[j] = 1;
}
void WriteDiv(int* D, int x, int* size) {
  *size = 0;
  for (int i = 1; i * i <= x; i++)
    if (x % i == 0) {
      D[*size] = i;
      (*size)++;
    }
  for (int i = (*size) - 1; i >= 0; i--)
    if (x / D[i] != D[i]) {
      D[(*size)] = (x / D[i]);
      (*size)++;
    }
}
int main() {
  bool is_one_only = 1;
  int n = 0, input = 0, ans = 0, size = 0;
  bool* P;
  int* Q;
  int* D;
  cin >> n;
  P = new bool[100001]{};
  Q = new int[100001]{};
  D = new int[100001]{};
  WritePrime(P, n);
  for (int i = 0; i < n; i++) {
    cin >> input;
    if (input != 1) is_one_only = 0;
    WriteDiv(D, input, &size);
    for (int j = 0; j < size; j++)
      if (!P[D[j]]) Q[D[j]]++;
  }
  for (int i = 0; i < 100001; i++)
    if (!P[i] && Q[i] > ans) ans = Q[i];
  if (is_one_only)
    cout << 1;
  else
    cout << ans;
  delete[] P;
  delete[] Q;
  delete[] D;
  return 0;
}
