# エラトステネスの篩いによる素数列の生成
def eratosthenes(n)
  list = Array.new(n - 1).map.with_index {|i, k| k + 2}
  result = [1]
  while list.last >= result.last**2
    p = list.shift
    result << p
    list.delete_if {|v| v % p == 0 }
  end
  result.shift
  result = result + list
  result.sort_by! {|v| v}
end

while line = gets
  n = line.chomp.to_i
  puts eratosthenes(n).size
end