import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    } main {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String inputStr = scanner.nextLine(); inputStr scanner.nextLine() scanner.nextLine scanner int inputVal = Integer.valueOf(inputStr); inputVal Integer.valueOf(inputStr) Integer.valueOf Integer inputStr int ans = 0; ans 0 while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        } inputVal > 0 inputVal 0 {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        } int length = String.valueOf(inputVal).length(); length String.valueOf(inputVal).length() String.valueOf(inputVal).length String.valueOf(inputVal) String.valueOf String inputVal if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            } length == 1 length 1 {
                ans += inputVal;
                inputVal = 0;
                continue;
            } ans += inputVal ans inputVal inputVal = 0 inputVal 0 continue; int nextVal = 0; nextVal 0 for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            } int i = 0; int i = 0; i 0 i < length -1 i length -1 length 1 i++ i++ i {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            } {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            } int a = (int)Math.pow(10, i) * 9; a (int)Math.pow(10, i) * 9 (int)Math.pow(10, i) Math.pow Math 10 i 9 nextVal += a nextVal a if (length % 2 == 1) ans += (inputVal - nextVal); length % 2 == 1 length % 2 length 2 1 ans += (inputVal - nextVal) ans (inputVal - nextVal) inputVal nextVal inputVal = nextVal inputVal nextVal System.out.println(ans < 0? 0: ans) System.out.println System.out System System.out ans < 0? 0: ans ans < 0 ans 0 0 ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String inputStr = scanner.nextLine();

        int inputVal = Integer.valueOf(inputStr);
        int ans = 0;

        while (inputVal > 0) {
            int length = String.valueOf(inputVal).length();
            if (length == 1) {
                ans += inputVal;
                inputVal = 0;
                continue;
            }
            int nextVal = 0;

            for (int i = 0; i < length -1; i++) {
                int a = (int)Math.pow(10, i) * 9;
                nextVal += a;
            }

            if (length % 2 == 1) ans += (inputVal - nextVal);
            inputVal = nextVal;
        }

        System.out.println(ans < 0? 0: ans);
    }
}