#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(1e9 + 1337);
const long long LINF = (long long)(4e18);
const double EPS = (double)(1e-11);
const int MAXN = 100005;
int n;
unordered_map<int, int> s;
int a[MAXN];
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
}
void solve() {
  init();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        s[a[i] / j]++;
        if (j != a[i] / j) {
          s[j]++;
        }
      }
    }
  }
  int mx = 1;
  for (auto it = s.begin(); it != s.end(); it++) {
    if (it->first != 1) {
      mx = max(mx, it->second);
    }
  }
  printf("%d\n", mx);
}
int main() { solve(); }
