#include <bits/stdc++.h>
int ifPrime(int number) {
  int count = 1, isprime = 0;
  while (count < number) {
    if (number % count == 0) {
      isprime = isprime + 1;
    }
    count = count + 1;
  }
  if (isprime == 1) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int prime_number = 0, count = 0, answer = 0;
  int prime[10000];
  scanf("%d", &prime_number);
  while (count < prime_number) {
    scanf("%d", &prime[count]);
    count = count + 1;
  }
  count = 0;
  while (count < prime_number) {
    answer = answer + ifPrime(prime[count]);
    count = count + 1;
  }
  printf("%d\n", answer);
  return 0;
}
