NUM_MAX = 1000000

a = Array.new(NUM_MAX, true)

i = 2
while i*i < NUM_MAX do
	if a[i] == true then
		j = i*i
		while j < NUM_MAX do
			a[j] = false
			j += i
		end 
	end
	i += 1
end

while ns = gets do
	n = ns.to_i

	s = 0

	i = 2
	while i <= n do
		if a[i] then
			s += 1
		end
		i += 1
	end

	puts s
end