#include <bits/stdc++.h>
int isPrime(int a) {
  int i, j, k;
  if (a <= 1) return 0;
  int* Num = (int*)malloc(sizeof(int) * (a - 2));
  for (i = 0; i < a - 2; i++) Num[i] = 0;
  if (Num == NULL) exit(0);
  for (i = 0; i < a - 2; i++) {
    k = i + 2;
    if (Num[i] == 1) continue;
    if ((a % k) == 0)
      return 0;
    else {
      for (j = 1; j <= (a / k); j++) Num[i * j] = 1;
    }
  }
  return 1;
}
int main(void) {
  int N, i, Num, CountPrime = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &Num);
    if (isPrime(Num) == 1) CountPrime++;
  }
  printf("%d\n", CountPrime);
  return 0;
}
