import scala.io.StdIn.readInt

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

  def main(args:Array[String]) = {
    val n = readInt
    println((for {
      i <- 0 until n
      if isPrime(readInt)
    } yield 1).length)
  }
}