def prm(n)
	a = Array.new(n, true)
	a[0] = false
	(2..n**(0.50)).each{|i|
		if a[i-1] then
			(2..(n/i)).each {|j|
				a[i*j-1] = false
			}
		end
	}
	p a.count(true)
end

while line = gets do
	prm(line.to_i)
end