include Math
def prime_judge(num)
  judge = 0
  i = 2
  while i <= sqrt(num)
    if num % i == 0
      judge =  1
      break
    end
    i += 1
  end
  return judge
end

n = gets.to_i
count = 0
n.times do
  if prime_judge(gets.to_i) == 0
    count += 1
  end
end
puts count