local N = io.read("n")
local a = 0
for i=1,N do
    if i < 10 then
        a = a + 1
    elseif i >= 100 then
        if i < 1000 then
            a = a + 1
        elseif i >= 10000 then
            if i < 100000 then
                a = a + 1
            end
        end
    end
end
print(a)