max_n = 999999
?´???°s = Array.new(max_n + 1, true)
?´???°?????°list = Array.new(max_n + 1, 0)

max = Math.sqrt(max_n).to_i

?´???°s[0] = ?´???°s[1] = false

(2..max_n).each do |x|
  next unless ?´???°s[x]

  k = 2 * x
  while k <= max_n
    ?´???°s[k] = false
    k += x
  end
end

sum = 0
(2..max_n).each do |x|
  sum += 1 if ?´???°s[x]
  ?´???°?????°list[x] = sum
end

while line = STDIN.gets
  n = line.to_i
  puts ?´???°?????°list[n]
end