#include <bits/stdc++.h>
using namespace std;
bool setPrime(int size, bool isPrime[]) {
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i < size; ++i) {
    isPrime[i] = true;
  }
  for (int i = 2; (i * i) < size; ++i) {
    if (!isPrime[i]) {
      continue;
    }
    for (int j = i + i; j < size; j += i) {
      isPrime[j] = false;
    }
  }
}
int main(void) {
  const int size = 100000001;
  int n, count = 0;
  bool *isPrime = new bool[size];
  setPrime(size, isPrime);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int p;
    cin >> p;
    if (isPrime[p]) {
      ++count;
    }
  }
  cout << count << endl;
  delete[] isPrime;
  return 0;
}
