let input = require('fs').readFileSync('/dev/stdin', 'UTF-8');
let array = (input.trim()).split('\n').map(Number);
array.shift();
       
let countPrime = 0;
array.forEach(function(num) {
  if ((Prime(num)) == true) {
    countPrime++;
  }
})
console.log(countPrime);
       
function Prime(num) {
       
  if (num === 2) {
    return true;
  }
  if (num % 2 === 0) {
    return false;
  }
       
  for (let i = 2; i <= Math.sqrt(num); i++) {
    if (num % i === 0) {
      return false;
    }
  }
  return true;
}
