#include <bits/stdc++.h>
int isPrime(int);
int main() {
  int i, n;
  int count = 0;
  int num;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    if (isPrime(num) == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
int isPrime(int num) {
  if (num <= 1 || (num % 2 == 0 && num != 2)) return -1;
  for (int i = 3; i < num; i += 2)
    if (num % i == 0) return -1;
  return 1;
}
