#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N = 1;
  int primes[1300] = {0};
  int i, j;
  bool isprime;
  int input;
  int count = 0;
  primes[0] = 2;
  for (i = primes[N - 1] + 1; i < 10000; i++) {
    isprime = true;
    for (j = 0; j < N; j++) {
      if (!(i % primes[j])) {
        isprime = false;
        break;
      }
    }
    if (isprime) {
      primes[N] = i;
      N++;
    }
  }
  cin >> input;
  while (cin >> input) {
    for (j = 0; j < N; j++) {
      if (input == primes[j]) {
        count++;
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}
