import scala.io.StdIn

object Main {
  var dp:Array[Boolean] = Array.fill(10001)(true)
  def makePrimeTable(){
    dp(0) = false;
    dp(1) = false;
    for(i <- 2 to 10000){
      dp(i) match {
        case true => (i + i to 10000 by i).toList.foreach(x => dp(x) = false)
        case _ =>
      }
    }
  }

  def main(args: Array[String]){
    makePrimeTable()
    val N = StdIn.readInt()
    var res = 0
    for(i <- 0 to N - 1){
      val num = StdIn.readInt()
      if(dp(num)){
        res = res + 1
      }
    }
    println(res)
  }
}