len = 1000000
p = Array.new(len,1)
p[0] = 0
i = 1
m = Math.sqrt(len).to_i
loop do
  i += 1
  i += 1 while p[i-1] == 0 && i < m
  j = i
  p[j-1] = 0 while (j += i) <= len
  break if i == m
end

(1..(len-1)).each do |i|
  p[i] += p[i-1]
end

begin
  while (n = STDIN.readline.chomp.to_i)
    puts p[n-1]
  end
rescue
  exit
end