BOJ-1978

const fs = require("fs")
const [n, arr] = fs.readFileSync("/dev/stdin").toString().trim().split("\n")

console.log(
  arr.split(" ").filter(v => {
    const num = parseInt(v)

    for (let i = 2; i < num / 2; i++) {
      if (num % i === 0) return false
    }

    if (num === 1) return false
    return true
  }).length
)