import java.io.*;
import java.util.*;


public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    } main {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    } FastScanner sc = new FastScanner(System.in); sc new FastScanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int digit = String.valueOf(n).length(); digit String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n int count = 0; count 0 for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        } int i = 1; int i = 1; i 1 i < digit i digit i++ i++ i {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        } {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        } if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            } i % 2 == 1 i % 2 i 2 1 {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            } int ten = 1; ten 1 for (int j = 1; j < i; j++) {
                    ten *= 10;
                } int j = 1; int j = 1; j 1 j < i j i j++ j++ j {
                    ten *= 10;
                } {
                    ten *= 10;
                } ten *= 10 ten 10 count += 9 * ten count 9 * ten 9 ten if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        } digit % 2 == 1 digit % 2 digit 2 1 {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        } int ten = 1; ten 1 for (int i = 1; i < digit; i++) {
                ten *= 10;
            } int i = 1; int i = 1; i 1 i < digit i digit i++ i++ i {
                ten *= 10;
            } {
                ten *= 10;
            } ten *= 10 ten 10 count += ((n / ten - 1) * ten) + n % ten + 1 count ((n / ten - 1) * ten) + n % ten + 1 ((n / ten - 1) * ten) + n % ten + 1 ((n / ten - 1) * ten) (n / ten - 1) n / ten n ten 1 ten n % ten n ten 1 System.out.println(count) System.out.println System.out System System.out count String[] args args static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    } FastScanner private BufferedReader reader; reader private StringTokenizer tokenizer; tokenizer public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } FastScanner {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) tokenizer = null tokenizer null InputStream in in public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        } nextLine {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        } if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    return reader.readLine();
                } return reader.readLine(); reader.readLine() reader.readLine reader return tokenizer.nextToken("\n"); tokenizer.nextToken("\n") tokenizer.nextToken tokenizer "\n" public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } nextLongArray {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
                a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
} Main
import java.io.*;
import java.util.*;


public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int digit = String.valueOf(n).length();
        int count = 0;
        for (int i = 1; i < digit; i++) {
            if (i % 2 == 1) {
                int ten = 1;
                for (int j = 1; j < i; j++) {
                    ten *= 10;
                }
                count += 9 * ten;
            }
        }
        if (digit % 2 == 1) {
            int ten = 1;
            for (int i = 1; i < digit; i++) {
                ten *= 10;
            }

            count += ((n / ten - 1) * ten) + n % ten + 1;
        }

        System.out.println(count);
    }


    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }


        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}