#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int A[n];
  map<long long int, long long int> multi;
  for (long long int i = 0; i < n; i += 1) {
    cin >> A[i];
  }
  long long int cnt = 0;
  for (long long int i = 0; i < n; i += 1) {
    if (A[i] == 1) {
      cnt++;
    }
  }
  if (cnt == n) {
    cout << "1";
  } else {
    for (long long int i = 0; i < n; i += 1) {
      if (A[i] == 1) {
        continue;
      }
      for (long long int j = 2; j <= sqrt(A[i]); j += 1) {
        if (A[i] % j == 0) {
          if (j != A[i] / j) {
            multi[j]++;
            multi[A[i] / j]++;
          } else {
            multi[j]++;
          }
        }
      }
      multi[A[i]]++;
    }
    long long int max = std::numeric_limits<long long int>::min();
    for (map<long long int, long long int>::iterator itr = multi.begin();
         itr != multi.end(); itr++) {
      if ((itr->second) > max) {
        max = itr->second;
      }
    }
    cout << max;
  }
  return 0;
}
