#include <iostream>
#include <math.h>
using namespace std;

int prime(int x){
  int i=3;
  if(x==2)return 1;
  else if(x<2 || x%2==0)return 0;
  for(i; i<=sqrt(x); i+=2)if(x%i==0)return 0;

  return 1;
}

int main(){
  int i,n,x,count=0;
  cin>>n;
  for(i=0; i<n; i++){
  cin>>x;
  count+=prime(x);
  }
  cout<<count<<endl;
return 0;
}