import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int nod = 0; nod 0 int temp = n; temp n while (n != 0){
            n/=10;
            nod++;
        } n != 0 n 0 {
            n/=10;
            nod++;
        } n/=10 n 10 nod++ nod long sum = 0; sum 0 for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        } int i = 0; int i = 0; i 0 i < nod i nod i++ i++ i {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        } {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        } if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            } i%2!=0 i%2 i 2 0 {
                sum += Math.pow(10,i-1)*9;
            } sum += Math.pow(10,i-1)*9 sum Math.pow(10,i-1)*9 Math.pow(10,i-1) Math.pow Math 10 i-1 i 1 9 if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        } nod%2 != 0 nod%2 nod 2 0 {
            sum+= temp - Math.pow(10,nod-1) + 1;
        } sum+= temp - Math.pow(10,nod-1) + 1 sum temp - Math.pow(10,nod-1) + 1 temp - Math.pow(10,nod-1) temp Math.pow(10,nod-1) Math.pow Math 10 nod-1 nod 1 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 scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int nod = 0;

        int temp = n;
        while (n != 0){
            n/=10;
            nod++;
        }

        long sum = 0;
        for (int i = 0; i < nod; i++) {
            if(i%2!=0){
                sum += Math.pow(10,i-1)*9;
            }
        }

        if(nod%2 != 0){
            sum+= temp - Math.pow(10,nod-1) + 1;
        }

        System.out.println(sum);
    }
}
