n = gets.to_i
count = 0

n.times{|i|
    hit = false
    k = gets.to_i
    for j in 2..Math.sqrt(k)
        if k%j == 0
            hit = true 
            break
        end
        
    end
    count += 1 if !hit 
}

puts count
