#include <bits/stdc++.h>
int isPrime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
int main(void) {
  int n, i, count = 0;
  scanf("%4d", &n);
  for (i = 0; i < n; i++) {
    int p;
    scanf("%8d", &p);
    if (isPrime(p)) count++;
  }
  printf("%4d\n", count);
}
