#include <bits/stdc++.h>
int main(void) {
  int record, number, i, j, flag, primeCount = 0;
  scanf("%d", &record);
  for (j = 0; j < record; j++) {
    scanf("%d", &number);
    if (number == 2 || number == 3) flag = 1;
    for (i = 2; i < number; i++) {
      if (number % i == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) ++primeCount;
    flag = 0;
  }
  printf("%d\n", primeCount);
  return 0;
}
