N = gets.to_i

digit = N.to_s.length

count = 0

digit.times.each do |num|
  num += 1
  if num.odd?
    num_start = 10 ** (num - 1)
    num_end = 10 ** num - 1
    num_end = N < num_end ? N : num_end
    
    count += num_end - num_start + 1
  end
end

puts count