import scala.io.Source

object Main {

  def isPrime(n: Int): Boolean = {
    // TODO: Make it declarative
    if (n == 1) return false
    for(i <- 2 to Math.sqrt(n).toInt) {
      if(n % i == 0) return false
    }
    true
  }

  def main(args: Array[String]): Unit = {
    // Get interator of stdin
    val stdinIterator = Source.stdin.getLines()

    // Skip the first line
    stdinIterator.next()

    // Get input
    val numbers: Seq[Int] = stdinIterator.toSeq.map(_.toInt)

    // The number of primes in the numbers
    val nPrimes = numbers.count(isPrime(_))

    // Print the number of primes
    println(nPrimes)
  }
}
