import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    }

} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    }

} Main public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    } main {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    } try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        } {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        } BufferedInputStream in = new BufferedInputStream(System.in) BufferedInputStream in = new BufferedInputStream(System.in) new BufferedInputStream(System.in) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) new PrintWriter(new BufferedOutputStream(System.out)) Scanner sc = new Scanner(in); sc new Scanner(in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
                cnt += String.valueOf(i).length() % 2;
            } {
                cnt += String.valueOf(i).length() % 2;
            } cnt += String.valueOf(i).length() % 2 cnt String.valueOf(i).length() % 2 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 2 out.println(cnt) out.println out cnt String[] args args public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    }

} public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    }

} Main
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            // 12:39-

            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 1; i <= n; i++) {
                cnt += String.valueOf(i).length() % 2;
            }

            out.println(cnt);

        }
    }

}
