import java.lang.Math

fun isPrime(n: Int) : Boolean {
  val max = Math.sqrt(n.toDouble()).toInt() + 1
  for (x in 2 until max) {
    if (n % x == 0) {
      return false
    }
  }
  return true
}

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  var a = mutableListOf<Int>()
  for (x in 0 until n) {
    a.add(readLine()!!.toInt())
  }

  var cnt = 0
  for (i in a) {
    if (isPrime(i)) {
      cnt += 1
    }
  }
  println(cnt)
}
