// package app;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.StringJoiner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Objects; Objects java.util import java.util.Scanner; Scanner java.util import java.util.StringJoiner; StringJoiner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

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

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    } main {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 int placeNum = String.valueOf(N).length(); placeNum String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        } int i = 1; int i = 1; i 1 i < placeNum i placeNum i++ i++ i {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        } {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        } if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1); i % 2 == 1 i % 2 i 2 1 cnt += 9 * Math.pow(10, i - 1) cnt 9 * Math.pow(10, i - 1) 9 Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1; placeNum % 2 == 1 placeNum % 2 placeNum 2 1 cnt += N - Math.pow(10, placeNum - 1) + 1 cnt N - Math.pow(10, placeNum - 1) + 1 N - Math.pow(10, placeNum - 1) N Math.pow(10, placeNum - 1) Math.pow Math 10 placeNum - 1 placeNum 1 1 System.out.println(cnt) System.out.println System.out System System.out cnt final String[] args args public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    }
} public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    }
} Main
// package app;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.StringJoiner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long N = sc.nextLong();
        // long K = sc.nextLong();
        int N = sc.nextInt();

        int cnt = 0;
        int placeNum = String.valueOf(N).length();
        for (int i = 1; i < placeNum; i++) {
            if (i % 2 == 1) cnt += 9 * Math.pow(10, i - 1);
        }

        if (placeNum % 2 == 1) cnt += N - Math.pow(10, placeNum - 1) + 1;

        System.out.println(cnt);

    }
}