#include <bits/stdc++.h>
int a[100001];
using namespace std;
int prime(long long int k) {
  int i = 2;
  while (i * i <= k) {
    if (k % i == 0) return (0);
    i++;
  }
  return (1);
}
int main() {
  vector<int> v;
  vector<int> v1;
  for (int i = 2; i < 100000; i++)
    if (prime(i) == 1) v.push_back(i);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int s;
    cin >> s;
    a[s]++;
  }
  int z;
  for (int i = 0; i < v.size(); i++) {
    z = 0;
    int x = 1;
    while (v[i] * x <= 100000) {
      z += a[v[i] * x];
      x++;
    }
    v1.push_back(z);
  }
  int m = 0;
  for (int i = 0; i < v1.size(); i++) {
    if (v1[i] > m) m = v1[i];
  }
  if (m == 0)
    cout << 1;
  else
    cout << m;
}
