#include <bits/stdc++.h>
using namespace std;
const long long INF = 9e18;
const int mod = 4e4 + 7;
vector<int> prime;
bool p[100005];
void init() {
  p[1] = true;
  for (int i = 2; i <= 100005; i++) {
    if (!p[i]) {
      prime.push_back(i);
      for (int j = i + i; j < 100005; j += i) p[j] = true;
    }
  }
}
bool isp(int n) {
  for (int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  init();
  int n;
  cin >> n;
  int s[100005];
  int mx = 0;
  for (int i = 0; i < n; i++) scanf("%d", &s[i]), mx = max(mx, s[i]);
  sort(s, s + n);
  int ans = 1;
  int num[100005];
  for (int i = 2; i <= mx; i++)
    num[i] = upper_bound(s, s + n, i) - lower_bound(s, s + n, i);
  for (int i = 0; i < prime.size(); i++) {
    int sum = 0;
    int x = prime[i];
    for (int j = x; j <= mx; j++) {
      if (j % x == 0) sum += num[j];
    }
    ans = max(ans, sum);
  }
  cout << ans << endl;
}
