#include <bits/stdc++.h>
bool isprime(int x);
int main(void) {
  int n = 0;
  int x = 0;
  int count = 0;
  scanf("%d", &n);
  for (; n > 0; n--) {
    scanf("%d", &x);
    if (isprime(x)) count++;
  }
  printf("%d\n", count);
  return 0;
}
bool isprime(int x) {
  int i = 0;
  if (x == 2) return true;
  if (x < 2 || x % 2 == 0) return false;
  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) return false;
    i = i + 2;
  }
}
