#include <bits/stdc++.h>
using namespace std;
int memo[(100000000 / (sizeof(int) * 8) + 1)];
inline void upflag(int i) {
  memo[i / (sizeof(int) * 8)] |= 1 << (i % (sizeof(int) * 8));
}
inline int getflag(int i) {
  return (memo[i / (sizeof(int) * 8)] >> (i % (sizeof(int) * 8))) & 1;
}
int main() {
  int N;
  cin >> N;
  int bign = 0;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    bign = max(bign, x);
  }
  int im = sqrt(100000000) + 1;
  for (int i = 2; i <= im; i += 2) {
    if (!getflag(i)) {
      for (int j = i * i; j <= 100000000; j += i) {
        upflag(j);
      }
    }
  }
  int cnt = 0;
  for (int i = 2; i <= bign; i++) {
    if (!getflag(i)) cnt++;
  }
  cout << cnt << endl;
}
