#coding:utf-8
def prime(num)
num_sqrt = Math.sqrt(num).to_i
a = Array.new(num,1)
  for i in 2..num_sqrt
    if a[i]==1
  	  for j in 1..num_sqrt
  	    a[i*j] = nil if i*j <= num
  	  end
    end
  end
  return a.compact.size-1
end

while (input = STDIN.gets)!=nil do
  break if input == "\n"
  print(prime(input.to_i),"\n")
end