#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> ar(n);
  for (int i = 0; i < n; ++i) cin >> ar[i];
  vector<int> count(100100, 0);
  int div;
  for (int i = 0; i < n; ++i) {
    count[ar[i]]++;
    for (int j = 2; j < (int)sqrt(ar[i]) + 1; ++j) {
      if (ar[i] % j == 0) {
        count[j]++;
        div = ar[i] / j;
        if (div != j && div != 1) count[div]++;
      }
    }
  }
  int max = 0;
  for (int i = 2; i < 100001; ++i)
    if (count[i] > max) max = count[i];
  if (max == 0) max = 1;
  cout << max;
  cout << endl;
  return 0;
}
