object Main extends App {
  // The size of Int is enough since 2 <= x <= 10^8
  def isPrime(x: Int): Boolean = x match {
    case 1 => false
    case 2 => true
    case _ if x % 2 == 0 => false
    case _ =>
      val upperLimit = scala.math.sqrt(x).toInt
      3.to(upperLimit, 2).view.forall(x % _ != 0)
  }


  val num = scala.io.StdIn.readLine().toInt
  val candidates = for (i <- 0 until num) yield scala.io.StdIn.readLine().toInt
  println(candidates.filter(isPrime).size)
}