object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)

    var n = 0
    for(_ <- 1 to scanner.nextInt) {
      val x = scanner.nextInt
      if((2 to x / 2).foldLeft(true){ case (f, d) => f & (x % d != 0) }) n = n + 1
    }
    println(n)
  }
}

