#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;


typedef long long ll;
struct NT{
  vector<bool>isprime;

  ll mod_mult(ll a, ll b, ll m) {
    ll res = 0;
    ll exp = a % m;
    while (b) {
      if (b & 1) {
        res += exp;
        if (res > m) res -= m;
      }
      exp <<= 1;
      if (exp > m) exp -= m;
      b >>= 1;
    }
    return res;
  }

  ll mod_exp(ll a, ll b, ll m) {
    ll res = 1;
    ll exp = a % m;
    while (b) {
      if (b & 1) res = mod_mult(res, exp, m);
      exp = mod_mult(exp, exp, m);
      b >>= 1;
    }
    return res;
  }

  bool miller_rabin(ll n, ll times) {
    if (n < 2) return false;
    if (n == 2) return true;
    if (!(n & 1)) return false;
    ll q = n-1;
    int k = 0;
    while (q % 2 == 0) {
      k++;
      q >>= 1;
    }
    for (int i = 0; i < times; i++) {
      ll a = rand() % (n-1) + 1;
      ll x = mod_exp(a, q, n);
      if (x == 1) continue;
      bool found = false;
      for (int j = 0; j < k; j++) {
        if (x == n-1) {
          found = true;
          break;
        }
        x = mod_mult(x, x, n);
      }
      if (found) continue;
      return false;
    }
    return true;
  }

  ll pollard_rho(ll n, int c) {
    ll x = 2;
    ll y = 2;
    ll d = 1;
    while (d == 1) {
      x = mod_mult(x, x, n) + c;
      y = mod_mult(y, y, n) + c;
      y = mod_mult(y, y, n) + c;
      d = __gcd((x-y >= 0 ? x-y : y-x), n);
    }
    if (d == n) return pollard_rho(n, c+1);
    return d;
  }
};

int sum;

int main(){
  NT N;
  ll n;
  cin>>n;
  while(n--){
    ll a;
    scanf("%ld",&a);
    if(N.miller_rabin(a,1))sum++;
  }
  cout<<sum<<endl;
}
