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