const s = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
const num = s[1].split(' ').map(Number);
let count = 0;

for(let n of num) {
    if(n==1) continue;
    let isPrime = true;

    for(let i=2; i*i<=n; i++){
        if(n%i==0){
            isPrime = false;
            break;
        }
    }

    if(isPrime) count++;
}

console.log(count);