"use strict";
const main = arg => {
  let Num = arg;
  //桁数が奇数のものをまずは足し合わせ
  let keta = Num.length;
  let ans1 = 0;
  let rest = 0;
  for(let i = 0 ; i < keta - 1; i++){
	if(i % 2 == 0){
      ans1 += Number(9 * Math.pow(10,i));
    } else {
      continue;
    }
  }
  if(Num.length % 2 == 1){
  	rest = Num - Math.pow(10,Num.length- 1) + 1;
  }
  console.log(ans1 + rest);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
