#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)1e8;
bool sieve[MAX + 1];
int main() {
  sieve[0] = sieve[1] = true;
  for (int i = 4; i <= MAX; i += 2) {
    sieve[i] = true;
  }
  for (int i = 3; i * i <= MAX; i += 2) {
    if (sieve[i]) {
      continue;
    }
    for (int j = i * i; j <= MAX; j += i) {
      sieve[j] = true;
    }
  }
  int n;
  scanf("%d", &n);
  int cnt = 0;
  while (n--) {
    int num;
    scanf("%d", &num);
    if (!sieve[num]) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return (0);
}
