def prime_check(x)
		if x==2
			return true
		end
		if x <2 || x%2==0
			return false
		end
		i=3
		while i <= Math.sqrt(x).to_i
			if x % i ==0
				return 	false
			end
			i=i+2
		end
	return true
end


def prime_count(x)

	ary=[2]
	i=3
	while i <= x
		if prime_check(i)
			ary << i
		end
		i+=2
	end
	ary
end

max=prime_count(999999)


while n=gets
	n=n.to_i
	p max.select{|item| item <= n}.size
end