import java.util.*;


public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    }
} Main public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    } main {

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int sc = s.nextInt(); sc s.nextInt() s.nextInt s int judge = 0; judge 0 for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        } int i = 1; int i = 1; i 1 i < sc+1 i sc+1 sc 1 i++ i++ i {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        } {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        } if((String.valueOf( i ).length())%2 ==1){
                judge++;
            } (String.valueOf( i ).length())%2 ==1 (String.valueOf( i ).length())%2 (String.valueOf( i ).length()) String.valueOf( i ).length String.valueOf( i ) String.valueOf String i 2 1 {
                judge++;
            } judge++ judge System.out.println(judge) System.out.println System.out System System.out judge String[] args args public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    }
} public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    }
} Main
import java.util.*;


public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);

      	int sc = s.nextInt();

        int judge = 0;
        for (int i = 1; i < sc+1; i++) {
            if((String.valueOf( i ).length())%2 ==1){
                judge++;
            }
        }
        System.out.println(judge);

    }
}