N = gets.to_i
a = Array.new(N){0}
N.times do |i|
a[i] = gets.to_i
end
prime = Array.new
jd = true
prime.unshift(2)
N.times do |i|
	jd = true
prime.each do |n|
if(a[i] % n==0)
	jd = false
	break
end
end
if jd == true 
	prime.unshift(a[i])
	end
end

puts prime.length