object Main {
    def isPrime(n: Int) = n > 1 && (2 to math.sqrt(n).toInt).forall(n % _ != 0)

    def main(args: Array[String]) = {
        val in = io.Source.stdin.getLines.map(_.toInt).toSeq.tail
        println(in.count(isPrime))
    }
}