#include<bits/stdc++.h>
using namespace std;
int main(){
  int i,j,n,a,count=0,counta=0;
  cin>>n;
  for(i=0;i<n;i++){
    count=0;
    cin>>a;
    for(j=2;j*j<=a;j++){
      if(a%j==0){
	    count++;
	    break;
      }
    }
    if(count==0&&a>1)counta++;
  }
  cout<<counta<<endl;
  return 0;
}
