n = gets.to_i
count = 0

n.times do
  num = gets.to_i

  next if num == 1

  if num == 2 || num == 3
    count += 1
  elsif num.even?
    next
  else
    limit = num / 2

    limit += 1 if limit.even?

    3.step(limit, 2) do |i|
      break if num % i == 0
      count += 1 if i == limit
    end
  end
end

puts count