input = gets.to_i

digit = input.to_s.length

result = 0
if digit % 2 == 0
	while (digit - 2) >= 0
      result += (10 ** (digit - 1 ) - 10 ** (digit - 2))
      digit -= 2
    end
else
	result += (input - 10 ** (digit - 1))
    while (digit - 3) >= 0
      result += (10 ** (digit - 2 ) - 10 ** (digit - 3))
      digit -= 2
    end
  	result += 1
end
  
p result