#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int n;
int col[N + 1];
int s[N];
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  fill(col, col + N + 1, 0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    if (s[i] <= 3) {
      col[s[i]]++;
      continue;
    }
    col[s[i]]++;
    for (int j = 2; j * j <= s[i]; j++) {
      if (s[i] % j != 0) continue;
      col[j]++;
      if (j * j != s[i]) col[s[i] / j]++;
    }
  }
  int ans = 1;
  for (int i = 2; i <= N; i++) ans = max(ans, col[i]);
  cout << ans << endl;
  return 0;
}
