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