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

public class Main {
    private static final int MAX = Integer.MAX_VALUE;
    private static final int MIN = Integer.MIN_VALUE;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    }
    // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    }

    private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }



    static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    }
    static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    }
}
class Point {
    private int x;
    private int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

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

    public Integer nextInt(){
        return Integer.valueOf(next());
    }
    public Long nextLong() {
        return  Long.valueOf(next());
    }
    public Double nextDouble() {
        return Double.valueOf(next());
    }
    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    private static final int MAX = Integer.MAX_VALUE;
    private static final int MIN = Integer.MIN_VALUE;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    }
    // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    }

    private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }



    static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    }
    static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    }
} Main private static final int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE private static final int MIN = Integer.MIN_VALUE; MIN Integer.MIN_VALUE Integer Integer.MIN_VALUE public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream); out new InputReader.OutputWriter(outputStream) Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in String s = Integer.toString(n); s Integer.toString(n) Integer.toString Integer n int l = s.length(); l s.length() s.length s HashMap<Integer,Integer> map = new HashMap<>(); map new HashMap<>() map.put(1,9) map.put map 1 9 map.put(3,900) map.put map 3 900 map.put(5,90_000) map.put map 5 90_000 int ans = 0; ans 0 l-- l for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        } int i = 1; int i = 1; i 1 i <=l i l i+=2 i+=2 i 2 {
               ans+=map.get(i);
        } {
               ans+=map.get(i);
        } ans+=map.get(i) ans map.get(i) map.get map i if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        } s.length()%2!=0 s.length()%2 s.length() s.length s 2 0 {
            ans += n - Math.pow(10, l) + 1;
        } ans += n - Math.pow(10, l) + 1 ans n - Math.pow(10, l) + 1 n - Math.pow(10, l) n Math.pow(10, l) Math.pow Math 10 l 1 out.println(ans) out.println out ans out.flush() out.flush out String[] args args // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    } lowerBound {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    } int y = current.getY(); y current.getY() current.getY current int lo = 0; lo 0 int hi = p.length - 1; hi p.length - 1 p.length p p.length 1 while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        } lo<=hi lo hi {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        } int med = lo +(hi-lo)/2; med lo +(hi-lo)/2 lo (hi-lo)/2 (hi-lo) hi lo 2 if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            } y <= p[med].getX() y p[med].getX() p[med].getX p[med] p med {
                hi = med - 1;
            } hi = med - 1 hi med - 1 med 1 {
                lo = med + 1;
            } lo = med + 1 lo med + 1 med 1 return lo; lo Point [] p p Point current current private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    } upperBound {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    } int y = current.getY(); y current.getY() current.getY current int lo = 0; lo 0 int hi = p.length - 1; hi p.length - 1 p.length p p.length 1 while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        } lo<=hi lo hi {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        } int med = lo +(hi-lo)/2; med lo +(hi-lo)/2 lo (hi-lo)/2 (hi-lo) hi lo 2 if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            } y >= p[med].getX() y p[med].getX() p[med].getX p[med] p med {
                lo = med + 1;
            } lo = med + 1 lo med + 1 med 1 {
                hi = med - 1;
            } hi = med - 1 hi med - 1 med 1 return hi; hi Point [] p p Point current current static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    } numberOfSubsequences {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    } int [] dp = new int[b.length()+1]; dp new int[b.length()+1] b.length()+1 b.length() b.length b 1 dp[0] = 1 dp[0] dp 0 1 for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        } int i = 0; int i = 0; i 0 i < a.length() i a.length() a.length a i++ i++ i {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        } {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        } for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            } int j = b.length() - 1; int j = b.length() - 1; j b.length() - 1 b.length() b.length b 1 j >=0 j 0 j-- j-- j {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            } {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            } if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                } a.charAt(i) == b.charAt(j) a.charAt(i) a.charAt a i b.charAt(j) b.charAt b j {
                    dp[j+1]+=dp[j];
                } dp[j+1]+=dp[j] dp[j+1] dp j+1 j 1 dp[j] dp j return dp[dp.length - 1]; dp[dp.length - 1] dp dp.length - 1 dp.length dp dp.length 1 String a a String b b static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    } count {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    } int m = a.length(); m a.length() a.length a int n = b.length(); n b.length() b.length b long lookup[][] = new long[m + 1][n + 1]; lookup new long[m + 1][n + 1] m + 1 m 1 n + 1 n 1 for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0; int i = 0; int i = 0; i 0 i <= n i n ++i ++i i lookup[0][i] = 0; lookup[0][i] = 0 lookup[0][i] lookup[0] lookup 0 i 0 for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1; int i = 0; int i = 0; i 0 i <= m i m ++i ++i i lookup[i][0] = 1; lookup[i][0] = 1 lookup[i][0] lookup[i] lookup i 0 1 for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        } int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        } {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        } for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            } int j = 1; int j = 1; j 1 j <= n j n j++ j++ j {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            } {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            } if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j]; a.charAt(i - 1) == b.charAt(j - 1) a.charAt(i - 1) a.charAt a i - 1 i 1 b.charAt(j - 1) b.charAt b j - 1 j 1 lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j] lookup[i][j] lookup[i] lookup i j lookup[i - 1][j - 1] +
                            lookup[i - 1][j] lookup[i - 1][j - 1] lookup[i - 1] lookup i - 1 i 1 j - 1 j 1 lookup[i - 1][j] lookup[i - 1] lookup i - 1 i 1 j lookup[i][j] = lookup[i - 1][j] lookup[i][j] lookup[i] lookup i j lookup[i - 1][j] lookup[i - 1] lookup i - 1 i 1 j return lookup[m][n]; lookup[m][n] lookup[m] lookup m n String a a String b b class Point {
    private int x;
    private int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
} Point private int x; x private int y; y public int getX() {
        return x;
    } getX {
        return x;
    } return x; x public int getY() {
        return y;
    } getY {
        return y;
    } return y; y public Point(int x,int y) {
        this.x = x;
        this.y = y;
    } Point {
        this.x = x;
        this.y = y;
    } this.x = x this.x this this.x x this.y = y this.y this this.y y int x x int y y @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    } equals {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    } if (this == o) return true; this == o this o return true; true if (o == null || getClass() != o.getClass()) return false; o == null || getClass() != o.getClass() o == null o null getClass() != o.getClass() getClass() getClass o.getClass() o.getClass o return false; false Point point = (Point) o; point (Point) o return x == point.x &&
                y == point.y; x == point.x &&
                y == point.y x == point.x x point.x point point.x y == point.y y point.y point point.y Object o o @Override
    public int hashCode() {
        return Objects.hash(x, y);
    } hashCode {
        return Objects.hash(x, y);
    } return Objects.hash(x, y); Objects.hash(x, y) Objects.hash Objects x y class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

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

    public Integer nextInt(){
        return Integer.valueOf(next());
    }
    public Long nextLong() {
        return  Long.valueOf(next());
    }
    public Double nextDouble() {
        return Double.valueOf(next());
    }
    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} InputReader StringTokenizer tokenizer; tokenizer public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    } InputReader {
        super(new InputStreamReader(inputStream), 32768);
    } super(new InputStreamReader(inputStream), 32768) super new InputStreamReader(inputStream) 32768 InputStream inputStream inputStream public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } InputReader {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename))) super new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)) String filename filename public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } next {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            } catch (IOException e) {
                throw new RuntimeException();
            } IOException e {
                throw new RuntimeException();
            } throw new RuntimeException(); new RuntimeException() {
                tokenizer = new StringTokenizer(readLine());
            } tokenizer = new StringTokenizer(readLine()) tokenizer new StringTokenizer(readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public Integer nextInt(){
        return Integer.valueOf(next());
    } nextInt {
        return Integer.valueOf(next());
    } return Integer.valueOf(next()); Integer.valueOf(next()) Integer.valueOf Integer next() next public Long nextLong() {
        return  Long.valueOf(next());
    } nextLong {
        return  Long.valueOf(next());
    } return  Long.valueOf(next()); Long.valueOf(next()) Long.valueOf Long next() next public Double nextDouble() {
        return Double.valueOf(next());
    } nextDouble {
        return Double.valueOf(next());
    } return Double.valueOf(next()); Double.valueOf(next()) Double.valueOf Double next() next static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    } OutputWriter public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        } OutputWriter {
            super(outputStream);
        } super(outputStream) super outputStream OutputStream outputStream outputStream public OutputWriter(Writer writer) {
            super(writer);
        } OutputWriter {
            super(writer);
        } super(writer) super writer Writer writer writer public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        } OutputWriter {
            super(filename);
        } super(filename) super filename String filename filename public void close() {
            super.close();
        } close {
            super.close();
        } super.close() super.close super PrintWriter BufferedReader public class Main {
    private static final int MAX = Integer.MAX_VALUE;
    private static final int MIN = Integer.MIN_VALUE;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    }
    // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    }

    private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }



    static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    }
    static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    }
} public class Main {
    private static final int MAX = Integer.MAX_VALUE;
    private static final int MIN = Integer.MIN_VALUE;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    }
    // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    }

    private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }



    static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    }
    static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    }
} Main
import java.io.*;
import java.util.*;

public class Main {
    private static final int MAX = Integer.MAX_VALUE;
    private static final int MIN = Integer.MIN_VALUE;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);


        int n = in.nextInt();
        // 100 - 999
        //100_000 - 99_999
        String s = Integer.toString(n);
        int l = s.length();
        HashMap<Integer,Integer> map = new HashMap<>();
        map.put(1,9);
        map.put(3,900);
        map.put(5,90_000);
        int ans = 0;
        l--;
        for (int i = 1; i <=l; i+=2) {
               ans+=map.get(i);
        }
        if(s.length()%2!=0) {
            ans += n - Math.pow(10, l) + 1;
        }


        out.println(ans);






        out.flush();
    }
    // first team which home form equals to current guest form
    private static int lowerBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y <= p[med].getX()) {
                hi = med - 1;
            }
            else {
                lo = med + 1;
            }
        }
        return lo;
    }

    private static int upperBound(Point [] p, Point current) {
        int y = current.getY();
        int lo = 0;
        int hi = p.length - 1;
        while (lo<=hi) {
            int med = lo +(hi-lo)/2;
            if(y >= p[med].getX()) {
                lo = med + 1;
            }
            else {
                hi = med - 1;
            }
        }
        return hi;
    }



    static int numberOfSubsequences(String a, String b) {
        int [] dp = new int[b.length()+1];
        dp[0] = 1;
        for (int i = 0; i < a.length(); i++) {
            for (int j = b.length() - 1; j >=0;j--) {
                if(a.charAt(i) == b.charAt(j)) {
                    dp[j+1]+=dp[j];
                }
            }
        }
        return dp[dp.length - 1];
    }
    static long count(String a, String b)
    {
        int m = a.length();
        int n = b.length();

        // Create a table to store
        // results of sub-problems
        long lookup[][] = new long[m + 1][n + 1];

        // If first string is empty
        for (int i = 0; i <= n; ++i)
            lookup[0][i] = 0;

        // If second string is empty
        for (int i = 0; i <= m; ++i)
            lookup[i][0] = 1;

        // Fill lookup[][] in
        // bottom up manner
        for (int i = 1; i <= m; i++)
        {
            for (int j = 1; j <= n; j++)
            {
                // If last characters are
                // same, we have two options -
                // 1. consider last characters
                //    of both strings in solution
                // 2. ignore last character
                //    of first string
                if (a.charAt(i - 1) == b.charAt(j - 1))
                    lookup[i][j] = lookup[i - 1][j - 1] +
                            lookup[i - 1][j];

                else
                    // If last character are
                    // different, ignore last
                    // character of first string
                    lookup[i][j] = lookup[i - 1][j];
            }
        }

        return lookup[m][n];
    }
}
class Point {
    private int x;
    private int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Point point = (Point) o;
        return x == point.x &&
                y == point.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

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

    public Integer nextInt(){
        return Integer.valueOf(next());
    }
    public Long nextLong() {
        return  Long.valueOf(next());
    }
    public Double nextDouble() {
        return Double.valueOf(next());
    }
    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
}