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