#include<iostream>
using namespace std;

int prime(int a){
  if(a==1)return 0;
  else if(a==2)return 1;
  else if(a%2==0)return 0;
  for(int i=3;i*i<=a;i+=2){
    if(a%i==0)return 0;
  }
  return 1;
}

int main(){
  int a,b,k=0;
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>b;
    if(prime(b))k++;
  }
  cout<<k<<endl;
  return 0;
}


