import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    }
} 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 digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    } main {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int digits  = String.valueOf(N).length(); digits String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N int count = 0; count 0 for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        } int i = 1; int i = 1; i 1 i<=digits i digits i++ i++ i {
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        } {
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        } if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            } i%2!=0 i%2 i 2 0 {
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            } if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                } i==digits i digits {
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                } count = count + N-(int)Math.pow(10,digits-1)+1 count count + N-(int)Math.pow(10,digits-1)+1 count + N-(int)Math.pow(10,digits-1) count + N count N (int)Math.pow(10,digits-1) Math.pow Math 10 digits-1 digits 1 1 {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                } count = count + (int) Math.pow(10, i - 1) * 9 count count + (int) Math.pow(10, i - 1) * 9 count (int) Math.pow(10, i - 1) * 9 (int) Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 9 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    }
} 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 digits  = String.valueOf(N).length();
        int count = 0;
        for (int i = 1; i<=digits; i++){
            if (i%2!=0){
                if(i==digits){
                    count = count + N-(int)Math.pow(10,digits-1)+1;
                }else {
                    count = count + (int) Math.pow(10, i - 1) * 9;
                }
            }
        }
        System.out.println(count);
    }
}
