#include <bits/stdc++.h>
using namespace std;
int n, nums, maxn, cnt, ans = 1;
int s;
int ss[1000001];
int sh[1000001];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s);
    ss[s]++;
    maxn = max(maxn, s);
  }
  for (int i = 2; i <= maxn; i++) {
    if (!sh[i]) {
      cnt = 0;
      for (int k = 1; k * i <= maxn; k++) {
        sh[k * i] = 1;
        cnt += ss[k * i];
      }
      ans = max(ans, cnt);
    }
  }
  cout << ans;
}
