n = gets.strip.to_i
count = 0

while line = gets do
  num = line.strip.to_i
  root_num = Math.sqrt(num).floor

  can_divide = (2..root_num).any? do |i|
    num % i == 0
  end

  if !can_divide then
    count += 1
  end
end

p count