#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
const int mod = 1e9 + 7;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0)
    if (b & 1) {
      res = (long long)(res * 1ll * a);
      --b;
    } else {
      a = (long long)(a * 1ll * a);
      b >>= 1;
    }
  return (long long)res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(1e5 + 60);
  set<int> st;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v[x]++;
  }
  int m = 1e5 + 60;
  vector<char> prime(m + 1, true);
  prime[0] = prime[1] = false;
  for (int i = 2; i <= m; ++i)
    if (prime[i]) {
      st.insert(i);
      if (i * 1ll * i <= m) {
        for (int j = i * i; j <= m; j += i) prime[j] = false;
      }
    }
  int maxi = 1;
  for (auto t : st) {
    int ans = 0;
    for (int i = t; i < 1e5 + 60; i += t) {
      ans += v[i];
    }
    maxi = max(ans, maxi);
  }
  cout << maxi << endl;
  return 0;
}
