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

    var a = 0
    for(_ <- 1 to scanner.nextInt) {
      val x = scanner.nextDouble
      if((2 to math.sqrt(x).toInt).find(x % _ == 0).isEmpty) a = a + 1
    }
    println(a)
  }
}

