#include <bits/stdc++.h>
int isPrime(int);
int main() {
  int i, n, *A;
  int primen = 0;
  scanf("%d", &n);
  A = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) scanf("%d", A + i);
  for (i = 0; i < n; i++) {
    if (isPrime(A[i]) == 1) primen++;
  }
  printf("%d\n", primen);
  return 0;
}
int isPrime(int x) {
  int i;
  if (x == 2) return 1;
  if (x < 2 || x % 2 == 0) return -1;
  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) return false;
    i = i + 2;
  }
  return true;
}
