import scala.io.StdIn.readInt

object Main {
  def isPrime(n:Int):Boolean = (2 to Math.sqrt(n).toInt).forall(n%_ != 0)

  def main(args:Array[String]) = {
    val n = readInt
    println((0 until n).count { _ => isPrime(readInt) })
  }
}