#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
vector<long long> eratos(long long max) {
  vector<long long> primeVec;
  vector<bool> isprime;
  double sqrtmax = sqrt(max);
  isprime.resize(max + 1);
  isprime[0] = false;
  isprime[1] = false;
  for (long long i = 2; i < max + 1; i++) {
    isprime[i] = true;
  }
  for (long long i = 2; i < sqrtmax; i++) {
    if (isprime[i]) {
      for (int j = 0; i * (j + 2) < max + 1; ++j) {
        isprime[i * (j + 2)] = false;
      }
    }
  }
  for (long long i = 0; i < max + 1; i++) {
    if (isprime[i]) primeVec.push_back(i);
  }
  return primeVec;
}
int main() {
  vector<long long> sosuu;
  sosuu = eratos(100000000);
  int n;
  int ans = 0;
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    auto reslut = find((sosuu).begin(), (sosuu).end(), x);
    if (reslut != sosuu.end()) ans++;
  }
  cout << ans << endl;
}
