#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e8 + 5;
int isprime[maxn];
void maketable() {
  isprime[0] = isprime[1] = 1;
  int n = ceil(sqrt(maxn));
  for (int i = 2; i <= n; i++) {
    if (!isprime[i]) {
      for (int j = i + i; j < maxn; j += i) {
        isprime[j] = 1;
      }
    }
  }
}
int main() {
  maketable();
  int s, n, cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s);
    if (!isprime[s]) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
