#include <bits/stdc++.h>
enum { kSuccess, kError } checkNumRange(int num, int min, int max);
int isPrimeNum(int num);
int main(void) {
  int i;
  int num;
  int array[((int)10000)];
  int primeNumCount = 0;
  scanf("%d\n", &num);
  if (checkNumRange(num, ((int)1), ((int)10000)) == kError) {
    return -1;
  }
  for (i = 0; i < num; num++) {
    scanf("%d\n", &array[i]);
    if (checkNumRange(array[i], ((int)2), ((int)100000000)) == kError) {
      return -1;
    }
    if (isPrimeNum(array[i]) == 0) {
      ++primeNumCount;
    }
  }
  printf("%d\n", primeNumCount);
  return 0;
}
enum { kSuccess, kError } checkNumRange(int num, int min, int max) {
  return ((num >= min) && (num <= max)) ? kSuccess : kError;
}
int isPrimeNum(int num) {
  int i;
  if (num == 2) {
    return 0;
  }
  if ((num < 2) || ((num % 2) != 0)) {
    return -1;
  }
  i = 3;
  while (i <= sqrt(num)) {
    if ((num % i) == 0) {
      return -1;
    }
    i += 2;
  }
  return 0;
}
