#include <bits/stdc++.h>
int isPrime(int);
int main(void) {
  int i, a, n, c = 0, x;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (isPrime(x) == 1)
      c++;
    else
      continue;
  }
  printf("\n%d\n", c);
  return 0;
}
int isPrime(int x) {
  int i;
  if (x == 2) return 1;
  if ((x < 2) || (x % 2 == 0)) return 0;
  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) return 0;
    i += 2;
  }
  return 1;
}
