import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val ns = Vector.fill(n)(sc.nextInt())

    val value = ns.map(l(_))
    println(value.count(_ == true))

  }

  def l(x: Int, i: Int = 2): Boolean = {
    def ll(x: Int, c: Int, i: Int): Boolean = {
      x match {
        case 2 => true
        case _ if x % i == 0 => false
        case _ if i >= c => true
        case _ => ll(x, c, i + 1)
      }
    }
    ll(x, Math.ceil(Math.sqrt(x)).toInt, i)
  }

}

