local n = io.read("*n")
local cnt = 0
for i = 1, n do
  if i <= 9 then
    cnt = cnt + 1
  elseif 100 <= i and i <= 999 then
    cnt = cnt + 1
  elseif 10000 <= i and i <= 99999 then
    cnt = cnt + 1
  end
end
print(cnt)
