import scala.io.StdIn.readInt

object Main extends App {
  val n = readInt
  var ans = 0

  for (_ <- 1 to n) {
    val num = readInt
    if (isPrime(num)) ans += 1
  }

  println(ans)

  def isPrime(x: Int): Boolean = {
    if (x == 2) true
    else if (x < 2 || x % 2 == 0) false
    else {
      var i = 3
      while (i <= Math.sqrt(x)) {
        if (x % i == 0) return false
        i = i + 2
      }
      true
    }
  }
}
