n=gets.chomp.to_i
ary=Array.new(n)
k=0
j=3
for i in 0..n-1
	ary[i]=gets.chomp.to_i
	root=Math.sqrt(ary[i]).to_i
			if ary[i]==2 || ary[i]==3 || ary[i]==5 || ary[i]==7
				k += 1
			elsif ary[i]<2 || ary[i]%2==0
			else
				while j <= root
					if ary[i]%j==0
						break
					elsif j==root &&  ary[i]%j!=0
						k += 1
						break
					else
						k += 1
						break
					end
					j+=2
				end
			end
end
puts k