number = gets.chomp.to_i
length = number.to_s.length

num = 0
(length-1).times do |i|
  next if (i+1) % 2 == 0
  num += 9 * (10**i)
end

if length % 2 == 1 then
  t = 10**(length-1)
  num += number - t + 1
end

p num