target=gets.chomp
number=target.to_i
keta = target.to_s.length.to_i
total=0
1.step(keta-1,2) do |num|
  total=total+(9*10**(num-1))
end
if keta%2 == 1
  total=total+(number-(10**(keta-1)))+1
end
puts total
  