#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int s[maxn], cnt[maxn], n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    cnt[s[i]]++;
  }
  int mx = 0;
  for (int i = 2; i <= 100000; i++) {
    int k = 0;
    for (int j = i; j <= 100000; j += i) {
      k += cnt[j];
    }
    mx = max(mx, k);
  }
  cout << max(mx, 1);
}
