require 'prime'
def prime?(n)
	return false if n == 1
	for i in 2..n-1
		return false if n % i == 0
	end
	true
end

n = gets.strip.to_i
j = 0
for i in 0..n-1
	j += 1 if Prime.prime?(gets.strip.to_i)
end
puts j