#include <bits/stdc++.h>
int isPrime(int num) {
  if (num == 2) return 1;
  if (num < 2 || (num & 1) == 0) return 0;
  return (long long)pow(2LL, num - 1) % num == 1 ? 1 : 0;
}
void solver() {
  int N;
  int tmp;
  int sum = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &tmp);
    if (isPrime(tmp) == 1) {
      sum++;
    }
  }
  printf("%d\n", sum);
}
int main() {
  solver();
  return 0;
}
