def prime?(n)
  return 0 if n == 1
  return 1 if n == 2
  return 0 if n % 2 == 0
  i = 3
  limit = Math.sqrt(n)
  while i <= limit
    return 0 if n % i == 0
    i += 2
  end
  return 1
end

n = gets.to_i
as = []
n.times do
  as << gets.to_i
end

count = 0
as.each do |a|
  count += prime?(a)
end

puts count