#include <bits/stdc++.h>
int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*)b); }
int main() {
  int N;
  scanf("%d", &N);
  int m = N;
  int factors[100000];
  for (int i = 0; i < 100000; i++) {
    factors[i] = 0;
  }
  while (N--) {
    int temp;
    scanf("%d", &temp);
    int a = sqrt(temp);
    for (long long int i = 2; i <= a; i++) {
      if (temp % i == 0) {
        factors[i]++;
      }
      while (temp % i == 0) {
        temp /= i;
      }
    }
    if (temp > 1) {
      factors[temp]++;
    }
  }
  int ans = 1;
  for (long long int i = 0; i < 100000; i++) {
    ans = (((ans) > (factors[i])) ? (ans) : (factors[i]));
  }
  printf("%d\n", ans);
  return 0;
}
