n = gets.to_i
 
def prime?(number)
  return true if number == 2
  return false if number % 2 == 0
  i = 3
  max = Math.sqrt(number)
  while i <= max
    return false if number % i == 0
    i += 2
  end
  return true
end
 
a = []
n.times do
  a << gets.to_i
end
 
count = 0
a.each do |number|
  count += 1 if prime?(number)
end
 
puts count