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