import scala.io.StdIn

object Main extends App {

  val n = StdIn.readLine().trim.toInt
  
  def isPrime(x: Int): Boolean = {
    if (x == 2) {
      true
    }
    else if (x < 2 || x % 2 == 0) {
      false
    } else {
      !(3 to scala.math.sqrt(x).toInt by 2).exists(i => x % i == 0)
    }
  }

  println((0 until n).foldLeft(0){ (acc, _) =>
    val x = StdIn.readLine().trim.toInt
    acc + (if(isPrime(x)) 1 else 0)
  })

}

