//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)
  .map(Number)
  .map(function (x) {
    for (i = 2; i < x; i++)
      if (x % i === 0) return 0;
    return 1; })
  .reduce(function(x, y) { return x + y; }, 0);
console.log(line);