
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    }

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

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    } main {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in StringBuilder ans; ans int cnt = 0; cnt 0 for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        } {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        } ans = new StringBuilder(""+i) ans new StringBuilder(""+i) if (ans.length() % 2 != 0) {
                cnt++;
            } ans.length() % 2 != 0 ans.length() % 2 ans.length() ans.length ans 2 0 {
                cnt++;
            } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    }

} public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    }

} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        StringBuilder ans;
//        long cnt = 0;
        int cnt = 0;
        for (int i = 1; i <= n; i++) {

            ans = new StringBuilder(""+i);
            if (ans.length() % 2 != 0) {
                cnt++;
            }
        }

        System.out.println(cnt);

    }

}
