def check(n)
  return 1 if n == 2
  return 0 if n%2 == 0
  3.step(Math.sqrt(n),2) do |i|
    return 0 if n % i == 0
  end
  return 1
end

count = 0
gets.to_i.times do
  count = count + check(gets.to_i)
end
puts count

