import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        } int n=1; int n=1; n 1 n<=N n N n++ n++ n {
            if(Integer.toString(n).length()%2==1) ans++;
        } {
            if(Integer.toString(n).length()%2==1) ans++;
        } if(Integer.toString(n).length()%2==1) ans++; Integer.toString(n).length()%2==1 Integer.toString(n).length()%2 Integer.toString(n).length() Integer.toString(n).length Integer.toString(n) Integer.toString Integer n 2 1 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 0;
        for(int n=1; n<=N; n++){
            if(Integer.toString(n).length()%2==1) ans++;
        }
        System.out.println(ans);
    }
}
