#include <bits/stdc++.h>
void sieve();
int prime[10000 + 1];
int main() {
  int N, a, i, count = 0;
  sieve();
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a);
    if (prime[a]) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
void sieve() {
  int i, j;
  for (i = 0; i <= 10000; i++) {
    prime[i] = 1;
  }
  prime[0] = prime[1] = 0;
  for (i = 2; i * i <= 10000; i++) {
    if (prime[i]) {
      for (j = i * i; j <= 10000; j += i) {
        prime[j] = 0;
      }
    }
  }
}
