#include <bits/stdc++.h>
using namespace std;
int main() {
  int count[110000] = {0}, i, j, n, num, result = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> num;
    for (j = 1; j * j < num; j++) {
      if (num % j == 0) {
        count[j]++;
        count[num / j]++;
      }
    }
    if (j * j == num) count[j]++;
  }
  for (i = 2; i < 100000; i++) {
    result = max(result, count[i]);
  }
  cout << result << endl;
}
