n = gets.to_i
count = 0
n.times{
    number = gets.to_i
    prime = true
    for i in (2 .. Math.sqrt(number))
        if number % i == 0
            prime = false
            break
        end
    end
    count += 1 if prime
}
puts count