import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    }
} import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int oriN = N; oriN N int count = 0; count 0 while(N > 0) {
            N/=10;
            count++;
        } N > 0 N 0 {
            N/=10;
            count++;
        } N/=10 N 10 count++ count int t = count%2 == 1 ? count-2: count-1; t count%2 == 1 ? count-2: count-1 count%2 == 1 count%2 count 2 1 count-2 count 2 count-1 count 1 int n1 = 0; n1 0 for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        } int i = 1; int i = 1; i 1 i<= t i t i+=2 i+=2 i 2 {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        } {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        } n1 += Math.pow(10, i) - Math.pow(10, i)/10 n1 Math.pow(10, i) - Math.pow(10, i)/10 Math.pow(10, i) Math.pow Math 10 i Math.pow(10, i)/10 Math.pow(10, i) Math.pow Math 10 i 10 int n2 = 0; n2 0 if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        } count%2 == 1 count%2 count 2 1 {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        } n2 = oriN - (int)Math.pow(10, count-1) +1 n2 oriN - (int)Math.pow(10, count-1) +1 oriN - (int)Math.pow(10, count-1) oriN (int)Math.pow(10, count-1) Math.pow Math 10 count-1 count 1 1 System.out.println(n1+n2) System.out.println System.out System System.out n1+n2 n1 n2 String[] args args public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    }
} public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    }
} Main
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int oriN = N;

        int count = 0;
        while(N > 0) {
            N/=10;
            count++;
        }
        
       int t = count%2 == 1 ? count-2: count-1;
        
        int n1 = 0;
        for(int i = 1; i<= t; i+=2) {
            n1 += Math.pow(10, i) - Math.pow(10, i)/10;
        }

        int n2 = 0;
        if(count%2 == 1) {
            n2 = oriN - (int)Math.pow(10, count-1) +1;
        }

        System.out.println(n1+n2);
        
    }
}