def prime?(n)
  limit = Math.sqrt(n)
  d = 2
  is = true
  while d <= limit
    if (n % d) == 0
      is = false
      break
    end
    d += 1
  end
  is
end


n = gets.strip.to_i
prime = 0
n.times do
  if prime?(gets.strip.to_i)
    prime += 1
  end
end

puts prime