import scala.io.Source
import Math.sqrt

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

    println(lines.filter(_ != null).length)
  }

  def prime(n: Int): Boolean = (2 to sqrt(n).toInt).filter(n % _ == 0).length == 0
}