def isPrime(num)
		2.upto(num-1){|i|
			if i>8
				if i%2==0 || i%3==0 || i%5==0 || i%7==0 then
					next
				end
			end
			if num%i==0
				return
			end
		}
		$count += 1
end

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