//config = {input: 'tmp', newline: '\r\n'}; // win
config = {input: '/dev/stdin', newline: '\n'}; //linux

line = require('fs').readFileSync(config.input, 'ascii')
  .trim()
  .split(config.newline)
  .slice(1)
  .map(Number)
  .filter(function (x) {
    for (i = 2; i <= Math.floor(Math.sqrt(x)); i++)
      if (x % i === 0) return false;
    return true; })
  .length;
console.log(line);