n=gets.chomp.to_i
ary=Array.new(n)


k=0

for i in 0..n-1
	ary[i]=gets.chomp.to_i
	j=3
	root=Math.sqrt(ary[i]).to_i

	if ary[i]==2
		k+=1
	elsif ary[i]<2 || ary[i]%2==0
	elsif
		while j <= root
			if ary[i]%j==0
			j+=2
			end
		end
	else
		k+=1
	end
end
p k