import java.io.BufferedReader
import java.io.InputStreamReader

fun isPrime(n: Int): Boolean {
    when (n) {
        0 -> return false
        1 -> return false
        else -> return (i in 2..Math.sqrt(n.toDouble()).toInt()).all { n % i != 0 }
    }
}

fun main(args: Array<String>) {
    BufferedReader(InputStreamReader(System.`in`))
            .readText()
            .trim()
            .split(regex = """\s+""".toRegex())
            .map { it.toInt() }
            .drop(n = 1)
            .filter { isPrime(it) }
            .count()
            .let { println(it) }
}

