import java.io.*;
// import java.math.*;
// import java.util.*;
// import java.util.Map.*;
// import java.util.stream.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    }
} import java.io.*; io.* java public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    } main {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    } BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in)); reader 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 + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++; int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++; if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++; (Math.floor (Math.log10 (i)) + 1) % 2 == 1 (Math.floor (Math.log10 (i)) + 1) % 2 (Math.floor (Math.log10 (i)) + 1) Math.floor (Math.log10 (i)) Math.floor Math Math.log10 (i) Math.log10 Math i 1 2 1 ans++ ans System.out.println (ans) System.out.println System.out System System.out ans return; String[] args args public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    }
} public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    }
} Main
import java.io.*;
// import java.math.*;
// import java.util.*;
// import java.util.Map.*;
// import java.util.stream.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int N = Integer.parseInt (reader.readLine());
        int ans = 0;
        for (int i = 1; i < N + 1; i++)
            if ((Math.floor (Math.log10 (i)) + 1) % 2 == 1)
                ans++;
        System.out.println (ans);
        return;
    }
}