import scala.io.StdIn

object Main {
  def main(args: Array[String]){
    val N = StdIn.readInt()
    val inputs = (0 to N-1).map(_ => StdIn.readInt)
    println(inputs.foldLeft(0){(acc, i) => { acc +
      (if((2 to Math.sqrt(i).toInt).forall(i % _ != 0)) 1 else 0)
    }})
  }
}