#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long ll;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
bool isprime(int x){
  int i;
  if(x==2){
    return true;
  }

  if(x<2 ||x%2==0){
    return false;
  }
  i=3;
  while (i<=sqrt(x)) {
    if(x%i==0){
      return false;
    }
    i=i+2;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  int n,a,cnt=0;
  cin>>n;
  REP(i,n){
    cin>>a;
    if(isprime(a)){
      cnt++;
    }
  }
  cout <<cnt << '\n';
  return 0;
}

