const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.split("\n").map(Number);

let count = 0;

for(var i = 1;i<lines[0]+1;i++){
    if(lines[i]===1){
        count=count+1;
    }else if(lines[i]>3){
        for(var k = 2;k<Math.sqrt(lines[i])+1;k++){
            if(lines[i]%k===0){
                count = count +1;
                break;     
            }
        }
    }
}
console.log(lines[0]-count);
