function isPrime(num) {
    let c = Math.floor(Math.sqrt(num));
    while (c >= 2) {
        if(num % c === 0){
            return false;
        }
        c--;
    }
    return true;
}

function main(_stdin) {
    const stdin = _stdin.split('\n').filter(e => e.length).map(Number);
    const len = stdin.shift();
    let count = 0;

    for(let item of stdin) {
        if(isPrime(item)) {
            count++;
        }
    }
    console.log(count);
}


main(require('fs').readFileSync('/dev/stdin', 'utf8'));



