import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        }
    } import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        }
    } Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        } main {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int count=0; count 0 for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        } int i=1; int i=1; i 1 i<N+1 i N+1 N 1 i++ i++ i {
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        } {
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        } if(i<10){
                count++;
            } i<10 i 10 {
                count++;
            } count++ count if(100<=i && i<1000){
                count++;
            } 100<=i && i<1000 100<=i 100 i i<1000 i 1000 {
                count++;
            } count++ count if(10000<=i && i<100000){
                count++;
            } 10000<=i && i<100000 10000<=i 10000 i i<100000 i 100000 {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        }
    } public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        }
    } Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        //char[] S = sc.next().toCharArray();
        int count=0;
        for(int i=1; i<N+1; i++){
            if(i<10){
                count++;
            }
            if(100<=i && i<1000){
                count++;
            }
            if(10000<=i && i<100000){
                count++;
            }
        }

          System.out.println(count);
        }
    }