import java.util.Scanner;

class Main{
  public static void main(String[] arg){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    int Ans=0;
    if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    }
    if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    }
    if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    }
    System.out.println(Ans);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] arg){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    int Ans=0;
    if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    }
    if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    }
    if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    }
    System.out.println(Ans);
  }
} Main public static void main(String[] arg){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    int Ans=0;
    if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    }
    if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    }
    if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    }
    System.out.println(Ans);
  } main {
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    int Ans=0;
    if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    }
    if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    }
    if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    }
    System.out.println(Ans);
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int num=scan.nextInt(); num scan.nextInt() scan.nextInt scan int Ans=0; Ans 0 if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    } num<10 num 10 {
      Ans+=num;
    } Ans+=num Ans num {
      Ans+=9;
    } Ans+=9 Ans 9 if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    } num>=100 && num<1000 num>=100 num 100 num<1000 num 1000 {
      Ans+=num-99;
    } Ans+=num-99 Ans num-99 num 99 if(num>=1000){
      Ans+=900;
    } num>=1000 num 1000 {
      Ans+=900;
    } Ans+=900 Ans 900 if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    } num>=10000 && num<100000 num>=10000 num 10000 num<100000 num 100000 {
      Ans+=num-9999;
    } Ans+=num-9999 Ans num-9999 num 9999 if(num>=100000){
      Ans+=90000;
    } num>=100000 num 100000 {
      Ans+=90000;
    } Ans+=90000 Ans 90000 System.out.println(Ans) System.out.println System.out System System.out Ans String[] arg arg
import java.util.Scanner;

class Main{
  public static void main(String[] arg){
    Scanner scan=new Scanner(System.in);
    int num=scan.nextInt();
    int Ans=0;
    if(num<10){
      Ans+=num;
    }else{
      Ans+=9;
    }
    if(num>=100 && num<1000){
      Ans+=num-99;
    }else if(num>=1000){
      Ans+=900;
    }
    if(num>=10000 && num<100000){
      Ans+=num-9999;
    }else if(num>=100000){
      Ans+=90000;
    }
    System.out.println(Ans);
  }
}