#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n,count=0,k;
  cin >> n;
  int d;
  while(n--){
  	cin >>d;
  	k =1;
  	for(int i=2;i*i<=d;i++){
  		if(d%i==0){
  			k=0;
  			break;
  		}
  	}
  	count +=k;
  }

  cout << count << endl;
  return 0;

}
