def prime_number?(n)
  (2..n/2).each do |i|
    return false if n % i == 0
  end
  return true
end

max = STDIN.gets.chomp.to_i
count = 0
(1..max).each do |i|
  n = STDIN.gets.chomp.to_i
  count += 1 if prime_number?(n)
end

puts count