import java.util.*;
public class Main {
static int N= 0;

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
}
} import java.util.*; util.* java public class Main {
static int N= 0;

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
}
} Main static int N= 0; N 0 public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
} main {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N=sc.nextInt() N sc.nextInt() sc.nextInt sc int data[]= {9,900,90000}; data {9,900,90000} 9 900 90000 ArrayList<Integer> al =new ArrayList<Integer>(); al new ArrayList<Integer>() int count = 0; count 0 int keta=0; keta 0 int a=N; a N while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		} true {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		} int t =a%10; t a%10 a 10 a=a/10 a a/10 a 10 keta++ keta al.add(t) al.add al t if(a<1) break; a<1 a 1 break; int j=0; j 0 for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		} int i=0; int i=0; i 0 i<keta-1 i keta-1 keta 1 i+=2 i+=2 i 2 {	
			
			
			count += data[j];
			j++;
		} {	
			
			
			count += data[j];
			j++;
		} count += data[j] count data[j] data j j++ j if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		} keta %2 != 0 keta %2 keta 2 0 {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		} count+= N-Math.pow(10,keta-1)+1 count N-Math.pow(10,keta-1)+1 N-Math.pow(10,keta-1) N Math.pow(10,keta-1) Math.pow Math 10 keta-1 keta 1 1 System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main {
static int N= 0;

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
}
} public class Main {
static int N= 0;

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
}
} Main
import java.util.*;
public class Main {
static int N= 0;

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		int data[]= {9,900,90000};
				
		ArrayList<Integer> al =new ArrayList<Integer>();
		int count = 0;
		int keta=0;
		int a=N;
		while(true) {
	    int t =a%10;
		a=a/10;
		keta++;
		al.add(t);
		if(a<1) break;
	
		
		}
		
		int j=0;
		for(int i=0;i<keta-1;i+=2) {	
			
			
			count += data[j];
			j++;
		}
		if(keta %2 != 0) {
			
			
			count+= N-Math.pow(10,keta-1)+1;
		}
		
		
		System.out.println(count);
}
}
