import java.util.Scanner;
class Main{
  public static void main(String args[]){
	Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();
    int count=0;
    for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    }
    int answer=0;
    for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    }
    System.out.println(answer);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String args[]){
	Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();
    int count=0;
    for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    }
    int answer=0;
    for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    }
    System.out.println(answer);
  }
} Main public static void main(String args[]){
	Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();
    int count=0;
    for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    }
    int answer=0;
    for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    }
    System.out.println(answer);
  } main {
	Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();
    int count=0;
    for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    }
    int answer=0;
    for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    }
    System.out.println(answer);
  } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int num=scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner int count=0; count 0 for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    } int i=0; int i=0; i 0 i<=5 i 5 i++ i++ i {
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    } {
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    } if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        } num/((int)Math.pow(10,i))>0 num/((int)Math.pow(10,i)) num ((int)Math.pow(10,i)) Math.pow Math 10 i 0 {
        	count=i+1;
        } count=i+1 count i+1 i 1 {
        	break;
        } break; int answer=0; answer 0 for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    } int i=1; int i=1; i 1 i<=count i count i++ i++ i {
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    } {
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    } if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        } i%2==1 && i!=count i%2==1 i%2 i 2 1 i!=count i count {
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        } answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1) answer (int)Math.pow(10,i)-(int)Math.pow(10,i-1) (int)Math.pow(10,i) Math.pow Math 10 i (int)Math.pow(10,i-1) Math.pow Math 10 i-1 i 1 if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        } i%2==1 && i==count i%2==1 i%2 i 2 1 i==count i count {
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        } int add=num-(int)Math.pow(10,i-1)+1; add num-(int)Math.pow(10,i-1)+1 num-(int)Math.pow(10,i-1) num (int)Math.pow(10,i-1) Math.pow Math 10 i-1 i 1 1 answer+=add answer add if(i%2==0){
        	continue;
        } i%2==0 i%2 i 2 0 {
        	continue;
        } continue; System.out.println(answer) System.out.println System.out System System.out answer String args[] args
import java.util.Scanner;
class Main{
  public static void main(String args[]){
	Scanner scanner=new Scanner(System.in);
    int num=scanner.nextInt();
    int count=0;
    for(int i=0;i<=5;i++){
    	if(num/((int)Math.pow(10,i))>0){
        	count=i+1;
        }else{
        	break;
        }
    }
    int answer=0;
    for(int i=1;i<=count;i++){
      	if(i%2==1 && i!=count){
        	answer+=(int)Math.pow(10,i)-(int)Math.pow(10,i-1);
        }else if(i%2==1 && i==count){
        	int add=num-(int)Math.pow(10,i-1)+1;
          	answer+=add;
        }else if(i%2==0){
        	continue;
        }
    }
    System.out.println(answer);
  }
}