#include <bits/stdc++.h>
using namespace std;
int n;
int ar[100500];
int freq[100500];
int freq2[100500];
int main() {
  cin >> n;
  memset(freq, 0, sizeof(freq));
  vector<int> primes = {2, 3};
  freq[1] = -111111111;
  freq2[1] = -111111111;
  int maxi = 1;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    bool nothing = true;
    for (int k = 2; k < int(sqrt(ar[i])) + 1; k++) {
      if (ar[i] % k == 0) {
        freq[ar[i] / k] += 1;
        freq[k] += 1;
        if (ar[i] / k == k) freq[k] -= 1;
        nothing = false;
      }
    }
    if (nothing) {
      freq[ar[i]] += 1;
    }
  }
  for (int i = 0; i < 100010; i++) {
    maxi = max(maxi, freq[i]);
  }
  cout << maxi << endl;
}
