object Main extends App {
  val sc = new java.util.Scanner (Console.in)

  def nextInt() = Integer.parseInt(sc.next)

  def isprime(x:Int): Boolean = {
    if (x == 2)
      return true
    if (x < 2 || x % 2 == 0)
      return false

    var i = 3
    val sq = math.sqrt(x).toInt
    while (i <= sq) {
      if (x % i == 0)
        return false
      i += 2
    }
    return true
  }

  var n = nextInt
  var count = 0
  while (n > 0) {
    if (isprime(nextInt))
      count += 1
    n -= 1
  }
  println(count)
}

