#include <bits/stdc++.h>
using namespace std;
bool primes[100000000];
void Sieve() {
  for (int i = 2; i < 100000000; i++) {
    primes[i] = true;
  }
  primes[1] = false;
  for (int i = 2; i < 10000; i++) {
    if (primes[i] == true)
      for (int j = i; j * i <= 100000000; j++) {
        primes[j * i] = false;
      }
  }
}
bool IsPrime(int x) { return primes[x]; }
int main(void) {
  Sieve();
  int n, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p) == true) {
      c++;
    }
  }
  cout << c << endl;
  return 0;
}
