import scala.io.Source

object Main{
  def main(args: Array[String]){
    val lines = for{
      in <- Source.stdin.getLines.toList.map(_.toInt)
    }yield isPrime(in)

    println(lines.filter(identity).length)
  }

  def isPrime(n: Int): Boolean = (2 to n - 1).foldLeft(true)((acc: Boolean, x: Int) => if(acc) n % x != 0 else false)
}