
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    }
} Main public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    } main {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        } s.length() s.length s case 1: 1 case 1: System.out.println(Integer.parseInt(s)) System.out.println System.out System System.out Integer.parseInt(s) Integer.parseInt Integer s break; case 2: 2 case 2: System.out.println(9) System.out.println System.out System System.out 9 break; case 3: 3 case 3: System.out.println((9 + Integer.parseInt(s) - 99)) System.out.println System.out System System.out (9 + Integer.parseInt(s) - 99) 9 + Integer.parseInt(s) 9 Integer.parseInt(s) Integer.parseInt Integer s 99 break; case 4: 4 case 4: System.out.println(909) System.out.println System.out System System.out 909 break; case 5: 5 case 5: System.out.println((909 + Integer.parseInt(s) - 9999)) System.out.println System.out System System.out (909 + Integer.parseInt(s) - 9999) 909 + Integer.parseInt(s) 909 Integer.parseInt(s) Integer.parseInt Integer s 9999 break; default: default: System.out.println(90909) System.out.println System.out System System.out 90909 String[] args args public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    }
} public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        switch (s.length()) {
            case 1:
                System.out.println(Integer.parseInt(s));
                break;
            case 2:
                System.out.println(9);
                break;
            case 3:
                System.out.println((9 + Integer.parseInt(s) - 99));
                break;
            case 4:
                System.out.println(909);
                break;
            case 5:
                System.out.println((909 + Integer.parseInt(s) - 9999));
                break;
            default:
                System.out.println(90909);
        }
    }
}
