#include <bits/stdc++.h>
using namespace std;
int max_val = 1;
int sieve[100005];
map<int, int> lis;
void create() {
  for (int i = 2; i <= 100000; i++) {
    if (sieve[i] != 0) continue;
    int coun = 0;
    for (int j = i; j <= 100000; j += i) {
      if (j != 1) sieve[j] = 1;
      coun += lis[j];
    }
    max_val = max(coun, max_val);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    lis[a]++;
  }
  create();
  cout << max_val << endl;
  return 0;
}
