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

N.times do
  n = input_line.shift.to_i
  2.upto(n-1) do |i|
    if n % i == 0
      counter -= 1
      break
    end
  end
end

puts counter