def Prime?(n)
	return false if n == 1

	sqrtN = Math.sqrt(n).to_i
	$primelist.each { |p|
		break if p > sqrtN
		return false if n % p == 0
	}

	a = true
	max = $primelist[-1]
	if max < sqrtN
		(max+2).step(sqrtN, 2){ |i|
			isprime = true
			$primelist.each { |p|
				if i % p == 0
					isprime = false
					break
				end
			}
			if isprime
				$primelist << i
				if n % i == 0
					a = false
					break
				end
			end
		}
	end

	return a
end

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

n = 0
gets.to_i.times { n += 1 if Prime?(gets.to_i) }
puts "#{n}"