import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int ans=0;
   
		for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        }
    	System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int ans=0;
   
		for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        }
    	System.out.println(ans);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int ans=0;
   
		for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        }
    	System.out.println(ans);
    } main {
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int ans=0;
   
		for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        }
    	System.out.println(ans);
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans=0; ans 0 for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        } int c=1; int c=1; c 1 c<=n c n c++ c++ c {
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        } {
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        } if(String.valueOf(c).length()%2==1){
              ans++;
        } String.valueOf(c).length()%2==1 String.valueOf(c).length()%2 String.valueOf(c).length() String.valueOf(c).length String.valueOf(c) String.valueOf String c 2 1 {
              ans++;
        } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		int ans=0;
   
		for(int c=1;c<=n;c++){
        	if(String.valueOf(c).length()%2==1){
              ans++;
        }
        }
    	System.out.println(ans);
    }
}