n=gets.chomp.to_i
number_digit = n.to_s.length
a = []
b = []
i = 0
sum = 0
while(i < number_digit) do
    a[i] = 10**i
    b[i] = [10**(i+1) - 1, n].min
    if (i+ 1).odd?
      sum += b[i] - a[i] + 1
    end
  	i += 1
end

puts sum
