def prime?(n)
  if 2 == n
    return true
  elsif n % 2 == 0
    return false
  else
    3.step(Math.sqrt(n).floor, 2) do |i|
      return false if n % i == 0
    end
    return true
  end
end

n = gets.to_i
cnt = 0
n.times do |i|
  cnt += 1 if prime?(gets.to_i)
end
puts cnt