#include <bits/stdc++.h>
int isPrime(int);
int main() {
  int i, j, N, c = 0, number[10000];
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &number[i]);
    j = isPrime(number[i]);
    if (j == 1) c++;
  }
  printf("%d\n", c);
  return 0;
}
int isPrime(int x) {
  int i;
  if (x <= 1) return 0;
  for (i = 2; i < x; i++) {
    if (x % i == 0) return 0;
  }
  return 1;
}
