n = gets.to_i
m = []
p_num = 0

n.times{
  m += [gets.to_i]
}

for x in m
  flag = 0
  for y in 2..(x**0.5)+1
    if x % y == 0
      flag = 1
      break
    end
  end
  if flag == 0
    p_num += 1
  end
end

puts "", p_num