#include <bits/stdc++.h>
using namespace std;
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
int prime[1003], cnt[1003];
map<int, int> M;
int main() {
  int ind = 0;
  for (int i = 2; i <= 337; i++) {
    int yes = 1;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) yes = 0;
    }
    if (yes) prime[++ind] = i;
  }
  int n = getnum();
  for (int i = 1; i <= n; i++) {
    int x = getnum();
    for (int j = 1; prime[j] <= x && j <= ind; j++) {
      if (x % prime[j] == 0) cnt[j]++;
      while (x % prime[j] == 0) x /= prime[j];
    }
    if (x != 1) M[x]++;
  }
  int ans = 1;
  for (auto it = M.begin(); it != M.end(); it++) {
    ans = max(ans, it->second);
  }
  for (int i = 1; i <= ind; i++) ans = max(ans, cnt[i]);
  cout << ans;
}
