table = [1] * 1000000
table[0] = 0
table[1] = 0

(2..1000).each do |i|
  next if table[i] == 0
  x = i*i
  while x < 1000000
    table[x] = 0
    x = x + i
  end
end

counter = 0
(0..999999).each do |i|
  counter += table[i]
  table[i] = counter
end

while input = gets.to_i
  puts table[input]
end