object Main extends App {
  val src: List[Int] = io.Source.stdin.getLines.toList.tail.map(_.toInt)

  def isPrime(n: Int): Boolean = {
    if (n == 1) false
    else if (n == 2) true
    else ! ((2 +: (3 to Math.sqrt(n).toInt by 2)) exists (n%_ == 0))
  }

  println(src.count(isPrime))
}