#include <bits/stdc++.h>
using namespace std;
int n, d[110000], l, m, v[110000], ans, cont;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &l);
    d[l]++;
    if (l > m) m = l;
  }
  ans = 1;
  for (int i = 2; i <= m; i++)
    if (v[i] == 0) {
      cont = 0;
      for (int j = 1; i * j <= m; j++) {
        v[i * j] = 1;
        if (d[i * j] > 0) cont += d[i * j];
      }
      if (cont > ans) ans = cont;
    }
  printf("%d\n", ans);
  return 0;
}
