#include <bits/stdc++.h>
using namespace std;
int n, a[100010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  int ans = 1;
  for (int i = 2; i <= 100000; i++) {
    int s = 0;
    for (int j = i; j <= 100000; j += i) {
      s += a[j];
    }
    ans = max(ans, s);
  }
  printf("%d\n", ans);
  return 0;
}
