import java.awt.*;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    }
} import java.awt.*; awt.* java import java.io.DataInputStream; DataInputStream java.io import java.io.FileInputStream; FileInputStream java.io import java.io.IOException; IOException java.io import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    }
} Main public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a=new int[100001]; a new int[100001] 100001 a[0]=0 a[0] a 0 0 for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        } int i=1; int i=1; i 1 i<a.length i a.length a a.length i++ i++ i {
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        } {
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        } String s=i+""; s i+"" i "" int len=s.length(); len s.length() s.length s if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1]; (len&1)==1 (len&1) len 1 1 {
                a[i]=a[i-1]+1;
            } a[i]=a[i-1]+1 a[i] a i a[i-1]+1 a[i-1] a i-1 i 1 1 a[i]=a[i-1] a[i] a i a[i-1] a i-1 i 1 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc System.out.println(a[n]) System.out.println System.out System System.out a[n] a n String[] args args public class Main {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    }
} public class Main {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    }
} Main
import java.awt.*;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args)throws IOException {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[100001];

        a[0]=0;
        for(int i=1;i<a.length;i++){
            String s=i+"";
            int len=s.length();
            if((len&1)==1){
                a[i]=a[i-1]+1;
            }
            else a[i]=a[i-1];
        }
        int n=sc.nextInt();
        System.out.println(a[n]);
    }
}