input = gets(nil)

ns = input.split("\n").map(&:to_i)

a = (2..ns.max).to_a

p = []

max = Math.sqrt(ns.max)
while true
  n = a.shift
  p.push(n)
  a.delete_if{|i| i % n == 0}
  break if a.first >= max
end

p += a

ns.each do |n|
  puts p.count{|i| i <= n}
end