#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
vector<int> v[100000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    for (int j = 2; j <= sqrt(a); j++) {
      if (a % j == 0) {
        m[j]++;
        while (a % j == 0) a /= j;
      }
    }
    if (a != 1) m[a]++;
  }
  int ans = 1;
  for (auto i : m) ans = max(ans, i.second);
  cout << ans;
  return 0;
}
