#include <bits/stdc++.h>
const int N = 10000;
int primes[N + 1];
int main(int argc, char const *argv[]) {
  for (int i = 2; i < N + 1; ++i) primes[i] = i;
  for (int i = 2; i < N + 1; ++i)
    if (primes[i] == i)
      for (int j = i * 2; j < N + 1; j += i) primes[j] = -1;
  int n, count = 0;
  scanf("%d", &n);
  while (n-- > 0) {
    int i;
    scanf("%d", &i);
    if (primes[i] == i) count++;
  }
  printf("%d\n", count);
  return 0;
}
