pr = Array.new(10**6,1)
(2..1000).each{|i|
	j = i * i
	while j < 10**6
		pr[j] = 0
		j += i
	end
}
pr[0] = pr[1] = 0
(2..10**6).each{|i|
	pr[i] = pr[i] == 1 ? pr[i-1]+1 : pr[i-1]
}
while gets
	p pr[$_.to_i]
end