#include <bits/stdc++.h>
using namespace std;
const int minx = 1e5 + 7;
int vis[minx];
int main() {
  int n, a;
  while (~scanf("%d", &n)) {
    int maxn = 0;
    memset(vis, 0, sizeof(vis));
    while (n--) {
      scanf("%d", &a);
      maxn = max(maxn, a);
      for (int i = 1; i * i <= a; i++) {
        if (a % i == 0) {
          vis[i]++;
          if (a / i != i) vis[a / i]++;
        }
      }
    }
    int ans = 1;
    for (int i = 2; i <= maxn; i++) ans = max(ans, vis[i]);
    printf("%d\n", ans);
  }
  return 0;
}
