function Main(input){ 
  var N = input.trim();
  N = parseInt(N,10);
  var array = input.trim().split("");
  var count = 0;
  switch(array.length){
    case 1:
      count += N;
    break;
    case 2:
      count += 9;
    break;
    case 3:
      count += (N-90);
    break;
    case 4:
      count += 909;
    break;
    case 5:
      count += (N-9090);
    break;
    case 6:
      count += 90909;
    break;
  }
  console.log(count);

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