#include <bits/stdc++.h>
using namespace std;
bool isprime(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
  ;
}
int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int count[100001];
  for (int i = 0; i < 100001; i++) count[i] = 0;
  for (int i = 0; i < n; i++) {
    int x = arr[i];
    if (isprime(x)) {
      count[x]++;
      continue;
    }
    for (int j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        count[j]++;
        if (j != x / j) count[x / j]++;
      }
    }
  }
  int m = 1;
  for (int i = 2; i < 100001; i++) {
    if (count[i] > m) m = count[i];
  }
  printf("%d\n", m);
  return 0;
}
