N = gets.chomp.to_i
result =
  if N <= 9
    N
  elsif N <= 99
    9
  elsif N <= 999
    9 + (N - 99)
  elsif N <= 9999
    9 + 900
  elsif N <= 99999
    9 + 900 + (N - 9999)
  else
    9 + 900 + 90000
  end

puts "#{result}\n"