import scala.io.StdIn

object Main {
  def isPrime(num: Int):Boolean = {
    for(i <- 2 until num){
      i match {
        case i if num % i == 0 => true
        case i if i * i > num => false
        case _ =>
      }
    }
    false
  }

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