def count(n,juge=true,k=0)
  max= juge ? ("9"*n).to_i : k
  min=("1"+"0"*(n-1)).to_i
  max-min+1
end

a=gets.chomp
len=a.length
sum=0
for i in 1..len-1
 sum+= count(i) if i%2!=0
end

puts len%2==0 ? sum : sum+count(len,false,a.to_i)