import java.util.*;
public class Main{

 public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    }

} import java.util.*; util.* java public class Main{

 public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    }

} Main public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int len = String.valueOf( n ).length(); len String.valueOf( n ).length() String.valueOf( n ).length String.valueOf( n ) String.valueOf String n int sum = 0; sum 0 for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        } int i =1; int i =1; i 1 i<len i len i++ i++ i {
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        } {
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        } if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          } i%2==1 i%2 i 2 1 {
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          } sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1)) sum sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1)) sum ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1)) (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1) (int)Math.pow(10, i) Math.pow Math 10 i 1 ((int)Math.pow(10, i-1)  - 1) (int)Math.pow(10, i-1) Math.pow Math 10 i-1 i 1 1 if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        } len%2 == 1 len%2 len 2 1 {
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        } int tmp = len - 1; tmp len - 1 len 1 sum = sum + n - ((int)Math.pow(10, tmp) - 1) sum sum + n - ((int)Math.pow(10, tmp) - 1) sum + n sum n ((int)Math.pow(10, tmp) - 1) (int)Math.pow(10, tmp) Math.pow Math 10 tmp 1 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{

 public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    }

} public class Main{

 public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    }

} Main
import java.util.*;
public class Main{

 public static void main(String[] args)
 {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int len = String.valueOf( n ).length(); 
        int sum = 0;
        for(int i =1;i<len;i++){
          if(i%2==1){
            sum = sum + ( (int)Math.pow(10, i)  - 1 - ((int)Math.pow(10, i-1)  - 1));
          }
        }
        if(len%2 == 1){
            int tmp = len - 1;
            sum = sum + n - ((int)Math.pow(10, tmp) - 1);
        }
        System.out.println(sum);
      
    }

}