num = gets.to_i
c = 0
def prime
	n = gets.to_i
	if n == 2
		return true
	end
	if n%2 == 0
		return false
	end
	i = 3
	while i*i <= n
		if n%i == 0
			return false
		end
		i += 2
	end
	return true
end
num.times do 
	if prime
		c += 1
	end
end
puts c
