#include <bits/stdc++.h>
int IsPrime(int);
int main() {
  int i, n, 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) {
  int i;
  if (num == 1) return 0;
  if (num == 2) return 1;
  if (num % 2 == 0) return 0;
  for (i = 2; i < sqrt(num); i++) {
    if (num % i == 0) return 0;
  }
  return 1;
}
