#include <bits/stdc++.h>
int isprime(long p) {
  int i;
  long ps;
  if (p == 2) return 1;
  if (p < 2 || p % 2 == 0) return 0;
  i = 3;
  ps = (long)sqrt(p);
  while (i < ps) {
    if (p % i == 0) return 0;
    i += 2;
  }
  return 1;
}
int main() {
  int N, i, ans = 0;
  long p;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%ld", &p);
    if (isprime(p)) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
