#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  int count = 1;
  int current;
  int maximum = -1;
  int mons[100001];
  int prime[100001];
  memset(mons, 0, sizeof(mons));
  memset(prime, 1, sizeof(mons));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    mons[x]++;
    if (x > maximum) {
      maximum = x;
    }
  }
  for (int i = 2; i <= maximum; i++) {
    current = 0;
    if (!prime[i]) {
      continue;
    }
    for (int j = i; j <= maximum; j += i) {
      prime[j] = 0;
      if (mons[j] > 0) {
        current += mons[j];
      }
    }
    if (current > count) {
      count = current;
    }
  }
  printf("%d", count);
  int d;
  cin >> d;
  return 0;
}
