process.stdin.resume();
process.stdin.setEncoding("utf8");

const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

const lines = [];

reader.on("line", (line) => {
  lines.push(line);
});

const isPrime = (n) => {
  if (n < 2) return false;
  if (n === 2) return true;
  if (n % 2 === 0) return false;

  let l = Math.sqrt(n);
  for (let i = 3; i <= l; i += 2) {
    if (n % i === 0) return false;
  }
  return true;
};

reader.on("close", () => {
  let n = lines[0] - 0;
  let count = 0;
  for (let i = 1; i <= n; i++) {
    if (isPrime(lines[i] - 0)) count++;
  }
  console.log(count);
});

