#include <bits/stdc++.h>
using namespace std;
unsigned long long powmod(unsigned long long a, unsigned long long b,
                          unsigned long long mod) {
  unsigned long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) {
      res = res * a % mod;
    }
    a = a * a % mod;
  }
  return res;
}
bool MillerRabin(unsigned long long n, unsigned long long k) {
  if (n == 2) {
    return true;
  }
  if (n == 1 || (n & 1) == 0) {
    return false;
  }
  random_device rd;
  mt19937 rand_src(rd());
  uniform_int_distribution<unsigned long long> rand_dist(1, n - 1);
  unsigned long long d = n - 1;
  while ((d & 1) == 0) {
    d >>= 1;
  }
  while (k--) {
    unsigned long long a = rand_dist(rand_src);
    unsigned long long t = d;
    unsigned long long y = powmod(a, t, n);
    while (t != n - 1 && y != 1 && y != n - 1) {
      y = (y * y) % n;
      t <<= 1;
    }
    if (y != n - 1 && (t & 1) == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  vector<unsigned long long> vc;
  int c = 0;
  cin >> n;
  while (n--) {
    unsigned long long x;
    cin >> x;
    vc.push_back(x);
  }
  for (size_t i = 0; i < vc.size(); i++) {
    if (MillerRabin(vc[i], 20)) {
      c++;
    }
  }
  cout << c << "\n";
}
