import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	}
} Main public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	} main {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = s.nextInt(); N s.nextInt() s.nextInt s int anser = 0; anser 0 for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    } int i=1; int i=1; i 1 i<N+1 i N+1 N 1 i++ i++ i {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    } {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    } if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	} String.valueOf(i).length() %2 == 1 String.valueOf(i).length() %2 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 2 1 {
	    		anser++;
	    		
	    	} anser++ anser System.out.println(anser) System.out.println System.out System System.out anser String[] args args public class Main {

	public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	}
} public class Main {

	public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
	    int N = s.nextInt();
	    int anser = 0;
	    for(int i=1; i<N+1; i++) {
	    	if(String.valueOf(i).length() %2 == 1) {
	    		anser++;
	    		
	    	}
	    }
	    
	    System.out.println(anser);
		
	}
}
