#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 5;
int node[26];
int s[N];
int maxn[N];
int ans, cnt;
int n;
int ss;
int main() {
  while (scanf("%d", &n) != EOF) {
    memset(maxn, 0, sizeof(maxn));
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      for (int j = 1; j * j <= x; j++) {
        if (x % j == 0) {
          maxn[j]++;
          if (x / j != j) {
            maxn[x / j]++;
          }
        }
      }
    }
    ans = 1;
    for (int i = 2; i <= N; i++) {
      ans = max(maxn[i], ans);
    }
    cout << ans << endl;
  }
  return 0;
}
