def isPrime(num)

	l = [*2..num]
	2.upto(num-1){|i|
		#p i
		if num%i != 0
			l.delete_if{|n| n%i==0}
		else
			return 
		end
	}
	$count += 1

end

n = gets.to_i
$count = 0
n.times{
 isPrime gets.to_i
}
puts $count