#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  int result = 0;
  cin >> n;
  map<int, int> count_map;
  vector<int> good_divisors = {2,  3,  5,  7,  11, 13, 17, 19, 23,
                               29, 31, 37, 41, 43, 47, 53, 59, 61,
                               67, 71, 73, 79, 83, 89, 97};
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    int good_divisors_id = 0;
    while (temp > 1 && good_divisors_id < good_divisors.size()) {
      if (temp % good_divisors[good_divisors_id] == 0) {
        if (count_map.count(good_divisors[good_divisors_id]) == 0)
          count_map.insert(make_pair(good_divisors[good_divisors_id], 1));
        else
          count_map[good_divisors[good_divisors_id]]++;
        while (temp % good_divisors[good_divisors_id] == 0)
          temp /= good_divisors[good_divisors_id];
      }
      good_divisors_id++;
    }
    if (count_map.count(temp) == 0)
      count_map.insert(make_pair(temp, 1));
    else
      count_map[temp]++;
  }
  for (auto elem : count_map) {
    if (elem.first != 1 && elem.second > result) result = elem.second;
  }
  result = max(1, result);
  cout << fixed << result;
  return 0;
}
