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

N.times do |i|
	jd = true
prime.each do |n|
	if(n==a[i])
		count+=1
		prime.unshift(a[i])
		jd = false
		break
	end
end
if jd==false
	next
end

prime.each do |n|
if(a[i] % n==0)
	jd = false
	break
end
end
if jd == true 
	prime.unshift(a[i])
	count+=1
	end
end

puts count