n=gets.chomp.to_i
t = n
kq = 0
stt = t.to_s.length
if stt == 1
  kq = n
elsif(stt%2==0)
  for num in 1..(stt-1) do
    if num % 2 == 1
      kq += 10**(num-1)*9
    end
  end  
elsif(stt%2==1)
  for num in 1..(stt-2) do
    if num % 2 == 1
      kq += 10**(num-1)*9
    end
  end
  kq = n + 1 - 10**(stt-1)
end
puts kq
