import scala.io.Source

object Main{
  def main(args: Array[String]){
    val primes = for{
      inputs <- Source.stdin.getLines
      prime <- inputs if isPrime(prime.toInt)
    }yield prime

    println(primes.length)
  }

  def isPrime(n: Int): Boolean = (2 to Math.sqrt(n).toInt).forall(n % _ != 0)
}