require 'prime'
n = gets.chomp.to_i
data = Array.new
n.times { |i|
	data[i] = gets.chomp.to_i
}
data.sort!
prime = Prime.each(10000).to_a

cnt=0
n.times { |i|
	limit = Math::sqrt(data[i])
	j = 0
	flg = 1
	while j<prime.length && limit<prime[j]
		if data[i]%prime[j]==0
			flg = 0
		end
		j += 1
	end
	if flg == 1
		cnt += 1
	end
}
puts cnt