#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
int GCD(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return (GCD(y, x % y));
}
const int MX = 1e5 + 5;
bool prime[MX];
int cnt[MX];
vector<int> lst;
void init() {
  prime[0] = prime[1] = 1;
  int i, j;
  for (i = 4; i < MX; i += 2) {
    prime[i] = 1;
  }
  for (i = 3; i * i <= MX; i += 2) {
    if (!prime[i])
      for (j = i * i; j < MX; j += i) {
        prime[j] = 1;
      }
  }
  for (i = 2; i < MX; i++) {
    if (!prime[i]) lst.push_back(i);
  }
}
int main() {
  init();
  int n, x, y, i, j, ans, mx, mxc;
  while (~scanf("%d", &n)) {
    memset(cnt, 0, sizeof cnt);
    mx = mxc = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &x);
      if (x == 1) {
        mxc = max(mxc, 1);
      }
      for (j = 0; j < lst.size() && lst[j] <= sqrt(x); j++) {
        y = lst[j];
        if (x % y == 0) {
          cnt[y]++;
          if (cnt[y] > mxc) {
            mxc = cnt[y];
          }
          while (x % y == 0) {
            x /= y;
          }
        }
      }
      if (x > 1 && !prime[x]) {
        cnt[x]++;
        if (cnt[x] > mxc) {
          mxc = cnt[x];
        }
      }
    }
    printf("%d\n", mxc);
  }
  return 0;
}
