#include <bits/stdc++.h>
using namespace std;
int a[100001], t, maxi = 1;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 2; i <= 100000; ++i) {
    a[i] = 0;
  }
  for (int i = 1; i <= n; ++i) {
    cin >> t;
    for (int j = 2; j <= int(sqrt(t)); ++j) {
      if (t % j == 0) {
        a[j]++;
        if (t / j != j) {
          a[t / j]++;
        }
      }
    }
    a[t]++;
  }
  for (int i = 2; i <= 100000; ++i) {
    maxi = max(a[i], maxi);
  }
  cout << maxi << endl;
  return 0;
}
