n = gets.to_i
r = 0
if n >= 10
  r += 9
else
  r = n
end

if 100 <= n && n < 1000
  r += n - 99
elsif n >= 1000
  r += 900
end

if 10000 <= n && n < 100000
  r += n - 9999
elsif n == 100000
  r += 90000
end
print r