import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

} Main public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    } main {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    } try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        } {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(reader.readLine()); N Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader int ans = 0; ans 0 for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            } {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            } if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                } 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 {
                    ans++;
                } 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) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(reader.readLine());

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

}
