#include <bits/stdc++.h>
using namespace std;
long long N = 2005;
vector<long long> row = {-1, 1, 0, 0};
vector<long long> col = {0, 0, -1, 1};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  long long ma = -1;
  map<long long, long long> m, ops;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    ma = max(ma, v[i]);
    m[v[i]]++;
  }
  vector<long long> ans(ma + 1);
  long long res = 1;
  for (long long i = 2; i <= ma; i++) {
    if (ans[i] == 0) {
      for (long long j = i; j <= ma; j += i) {
        if (m[j]) {
          ops[i] += m[j];
        }
      }
      res = max(ops[i], res);
    }
  }
  cout << res << '\n';
}
