function isprime(x){
if(x==2)return true;
if(x<2 || x%2==0)return false;
var i=3;
while(i<=Math.sqrt(x)){
   if(x%i==0)return false;
   i=i+2;
}
return true;
}

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
Arr.shift();
var cnt=0;
Arr.forEach(function(v){
if(isprime(v))cnt++;
});
console.log(cnt);