require 'prime'

input_line = []
while line = gets
  input_line << line.chomp
end
N = input_line.shift.to_i
counter = 0

N.times do
  n = input_line.shift.to_i
  if n.prime? == true
      counter += 1
  end
end

puts counter