n = gets.chomp.to_i
input_values = []
n.times do
  value = gets.chomp.to_i
  input_values.push(value)
end

def isprime(n)
 #  if n < 2
 #   return false
 # elsif n == 2
 #   return true
 # end
 #
 #  for i in 2..(n-1)
 #   if n % i == 0
 #      return false
 #    end
 #  end
 #  return true
 case n
  when 1
    false
  when 2
    true
  else
    (2..n-1).each do |m|
      q, r = n.divmod(m)
      return true if q < m
      return false if r.zero?
    end
  end
end


num_of_prime = 0
for i in 0..(n-1)
  if isprime(input_values[i]) == true
    num_of_prime += 1
  end
end

puts num_of_prime