var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
Arr.shift();
var max=Arr.reduce(function(a,b){return Math.max(a,b);});
var arr=[2];
for(var i=3;i<=max;i++){
var a=arr.some(function(v){return (num%v==0);});
if(!a)arr.push(i);
i++;
}
var num=0;
Arr.forEach(function(v){
if(arr.indexOf(v)!=-1)num++;
});
console.log(num);