#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int hash[100005] = {0};
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    hash[x]++;
  }
  int maxi = 1;
  for (int i = 2; i <= 100001; i++) {
    int c = 0;
    for (int j = i; j <= 100001; j += i) {
      if (hash[j]) c += hash[j];
    }
    maxi = max(c, maxi);
  }
  printf("%d\n", maxi);
  return 0;
}
