import scala.io.StdIn.readInt;
object Main {
    def main(args: Array[String]): Unit = {
        val n = readInt();
        var ret = 0;
        for (i <- (0 until n)) {
            ret += isPrime(readInt());
        }
        println(ret);
    }
    
    def isPrime(num: Int): Int = {
        if (num < 2) return 0;
        if (num == 2) return 1;
        if (num % 2 == 0) return 0;
        var i = 3;
        while (i * i <= num) {
            if (num % i == 0) return 0;
            i += 2;
        }
        return 1;
    }
}
