#include <bits/stdc++.h>
int isPrime(int);
int main() {
  int i, sumdata, data, count, answer;
  count = 0;
  scanf("%d", &sumdata);
  for (i = 0; i < sumdata; i++) {
    scanf("%d", &data);
    answer = isPrime(data);
    if (answer != -1) {
      count = count + answer;
    }
  }
  printf("%d", count);
  return 0;
}
int isPrime(int data) {
  int i;
  if (data == 2) {
    return 1;
  }
  if (data < 2 || data % 2 == 0) {
    return -1;
  }
  i = 3;
  while ((double)i <= sqrt(data)) {
    if (data % i == 0) {
      return -1;
    }
    i = i + 2;
  }
  return 1;
}
