#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 15;
const int Q = 1e9 + 7;
int cnt[M];
int main() {
  srand(time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  int ans = 1;
  for (int i = 2; i < M; i++) {
    int cur = 0;
    for (int j = i; j < M; j += i) {
      cur += cnt[j];
    }
    ans = max(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
