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

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

for x in 1..m.max
  f = false
  for y in 2...x
    if x % y == 0
      f = true
      break
    end
  end
  if f == false
    p_num += [x]
  end
end

puts (m & p_num).length