#include <bits/stdc++.h>
int isprime(int num) {
  int i;
  if (num == 2) return 1;
  if (num < 2 || num % 2 == 0) return 0;
  i = 3;
  while (i <= sqrt((double)num)) {
    if (num % i == 0) continue;
    i = i + 2;
  }
  return 1;
}
int main() {
  int i, N, A[10000], c = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  for (i = 0; i < N; i++) {
    c += isprime(A[i]);
  }
  printf("%d\n", c);
  return 0;
}
