#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
vector<int> s[100002];
int sie[100002];
int a[100002];
int main() {
  for (int i = 2; i <= 100000; i++) {
    if (!sie[i]) {
      for (int j = i + i; j <= 100000; j += i) {
        s[j].push_back(i);
        sie[j] = 1;
      }
    }
  }
  for (int i = 2; i <= 100000; i++) {
    if (!sie[i]) s[i].push_back(i);
  }
  int n;
  cin >> n;
  int sw = 0;
  for (int i = 0; i < n; i += 1) {
    int x;
    cin >> x;
    if (x == 1) sw++;
    for (int i = 0; i < s[x].size(); i++) a[s[x][i]]++;
  }
  int max1 = 0;
  for (int i = 2; i <= 100000; i++) max1 = max(max1, a[i]);
  if (sw == n)
    cout << 1 << endl;
  else
    cout << max1 << endl;
  return 0;
}
