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);
}
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz