#include <bits/stdc++.h>
int main() {
  int A[10000], i, j, number, p, q, count = 0;
  scanf("%d", &number);
  for (i = 0; i < number; i++) scanf("%d", &A[i]);
  for (i = 0; i < number; i++) {
    j = 3;
    while (j <= sqrt(A[i])) {
      if (A[i] % j == 0) continue;
      j = j + 2;
    }
    if (A[i] == 2)
      count++;
    else if (A[i] < 2 || A[i] % 2 == 0)
      continue;
    else
      count++;
  }
  printf("%d\n", count);
  return 0;
}
