#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#define fr first
#define sc second
#define INF 100000001
using namespace std;
bool Prime[INF]={true,true};
int main(){
  for(int i=3;i<=sqrt(INF);i += 2){
    if(!Prime[i]){
      for(int j=3;i*j<INF;j += 2){
        Prime[j*i] = true;
      }
    }
  }
  int n,a,cnt=0;
  cin >> n;
  while(n--){
    cin >> a;
    if(a == 2) cnt++;
    else if(a % 2 == 1 && !Prime[a]) cnt++;
  }
  cout << cnt << endl;
}