def Prime?(n)
	return false if n == 1
	return true if $primelist.include?(n)

	a = true
	$primelist.each { |p|
		break if p > n/2
		if n % p == 0
			a = false
			break
		end
	}
	return false if a == false

	max = $primelist.max
	if max < n / 2
		for i in max+1..n/2
			isprime = true
			$primelist.each { |p|
				isprime = false if i % p == 0
			}
			if isprime
				$primelist << i
				if n % i == 0
					a = false
					break
				end
			end

		end
	end

	return a
end

$primelist = Array.new(0)
$primelist << 2

list = Array.new
gets.to_i.times { list << gets.to_i }
list.sort!
n = 0
list.each{ |num| n += 1 if Prime?(num) }

puts "#{n}"