while max = STDIN.gets
# STDIN.gets.split("\n").map { |i| i.chomp.to_i }.each do |max|
  max = max.chomp.to_i
  lst = (3..max).select(&:odd?)
  result = []
  sqrt = Math.sqrt(max)

  loop do
    elem = lst.shift
    result << elem
    break if elem >= sqrt
    lst.delete_if { |i| i % elem == 0 }
  end

  puts (result + lst).unshift(2).count
end