n = gets.chomp.to_i
ns = []
pns = []
n.times do |i|
  ns.push(gets.to_i)
end
result = 0
e = n+1
e.times do |i|
if i == 2
  pns.push(i)
  result+=1
elsif i == 1
elsif i == 0
else
  judge = true
  pns.each do |number|
      if i % number == 0
        judge = false
        break
      end
  end
  if judge
    pns.push(i)
    result+=1
  end
end
end

