const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
let n = input.map(Number);
let count = 0;
function primeNumber (num) {
    if(num === 2) {
        return true;
    }
    if (num < 2 || num % 2 === 0) {
        return false;
    }
    let i = 3;
    while (i <= Math.sqrt(num)) {
            if(num % i === 0) {
                return false;
            }
            i = i + 2;
    }
    return true;
}

for (i=0; i<n.length; i++) {
    if (primeNumber(n[i])) count++;
}
console.log(count);
