input_line = []

while line = gets
  input_line << line.chomp
end

n = input_line.shift.to_i
counter = 0

def prime_number(x)
  flag = true

  2.upto(x-1) do |i|
    if x % i == 0
      flag = false
      break
    end
  end
  return flag == true ? true : false
end

n.times do |i|
  n = input_line.shift.to_i
  counter += 1 if prime_number(n)
end

puts counter