const assert = require("assert");

const isPrime = n => {
  if (n < 2) {
    return false;
  }
  if (n == 2) {
    return true;
  }
  if (n % 2 === 0) {
    return false;
  }
  m = parseInt(Math.sqrt(n), 10);
  for (let i = 3; i <= m; i += 2) {
    if (n % i === 0) {
      return false;
    }
  }

  return true;
};

console.log(isPrime(3));
console.log(isPrime(9));
console.log(isPrime(19));

const countPrime = numbers => {
  let counter = 0;
  numbers.forEach(n => {
    if (isPrime(n)) {
      counter = counter += 1;
    }
  });
  console.log(counter);
  return counter;
};

process.stdin.resume();
process.stdin.setEncoding("utf8");
let input_string = "";

process.stdin.on("data", chunk => {
  input_string += chunk;
});

process.stdin.on("end", () => {
  const lines = input_string.split("\n").filter(v => {
    return v !== "";
  });
  // console.log(lines);
  countPrime(lines);
});

