def is_prime?(x)
  return false if x < 2
  return true if x == 2
  return false if x % 2 == 0
  i = 3
  while i <= x / i do
    return false if x % i == 0
    i += 2
  end
  true
end

n = gets.to_i
numbers = (1..n).map {gets.to_i}
puts numbers.select {|x| is_prime?(x)}.size