function main(input){
    let lines = input.split("\n");
    let n = lines[0];
    let c = 0;
    for(let i = 1; i <= n; i++) c+= isPrime(Number(lines[i]));
    console.log(c);
}
function isPrime(x){
    if (x == 2) return 1;
    if (x < 2 || x %2 == 0) return 0;
    i = 3
    while (i <= Math.sqrt(x)){
        if(x%i == 0) return 0;
        i = i + 2
    }
 return 1;
}
main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));
