#include <bits/stdc++.h>
using namespace std;
int maximo = 0;
bool poke[100007];
int pokemones[100007];
void criba() {
  for (int i = 2; i <= 100000; i++) {
    if (poke[i] == false) {
      int cont = pokemones[i];
      for (int j = i + i; j <= 100000; j += i) {
        poke[j] = true;
        if (pokemones[j] > 0) {
          cont += pokemones[j];
        }
      }
      if (cont > maximo) {
        maximo = cont;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  int num;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    pokemones[num]++;
  }
  criba();
  maximo = max(1, maximo);
  cout << maximo;
  return 0;
}
