#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  int n, MX = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    arr[x]++;
    MX = max(MX, x);
  }
  MX += 5;
  int ans = 1;
  for (int i = 2; i < MX; i++) {
    int c = 0;
    for (int j = 0; j < MX; j += i) {
      c += arr[j];
    }
    ans = max(c, ans);
  }
  cout << ans;
  return 0;
}
