#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000000 + 1;
char isprime[MAXN];
void init() {
  memset(isprime, -1, sizeof(isprime));
  for (int i = 2; i < MAXN; i++) {
    if (isprime[i]) {
      for (long long j = ((long long)i) * i; j < MAXN; j += i) {
        isprime[j] = 0;
      }
    }
  }
}
int main() {
  int N;
  int cnt = 0;
  init();
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int e;
    scanf("%d", &e);
    if (isprime[e]) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
