#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
template <typename T>
void print2(T v) {
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v[i].size(); j++) cout << v[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
template <typename T>
void print_pair(T v) {
  for (int i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
  cout << endl;
}
int main() {
  int n, tmp;
  scanf("%d", &n);
  map<int, int> m;
  if (n == 1) {
    scanf("%d", &tmp);
    printf("1");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    bool flag = false;
    if (tmp % 2 == 0) {
      if (!flag) flag = true;
      m[2]++;
      while (tmp % 2 == 0) tmp /= 2;
    }
    int j = 3, sqrt_n = int(sqrt((float)tmp)) + 1;
    while (tmp > 1) {
      if (j > sqrt_n) {
        m[tmp]++;
        break;
      }
      if (tmp % j == 0) {
        if (!flag) flag = true;
        m[j]++;
        while (tmp % j == 0) tmp /= j;
      }
      j += 2;
    }
  }
  int answ = 0;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    int tmp = it->second;
    if (tmp > answ) answ = tmp;
  }
  if (answ == 0) answ = 1;
  printf("%d", answ);
  return 0;
}
