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