NUM = 1000000
p = []

(0..1).each{ p << false }

(2..NUM).each{ |i|
	p << true
}

(2..Math::sqrt(NUM)).each{ |i|
	if p[i] then
		(2*i).step(NUM,i){|j|
#		(2*i..NUM).each{ |j|
#			if ((j%i) == 0) then p[j] = false end
			p[j] = false
		}
	end
}

while n = gets
#n=10
	count=0
	(0..n.to_i).each{ |i|
		if p[i] then count = count + 1 end
	}
	
	puts count
end