import java.util.Scanner;

 class Main {
	public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0 ;
		for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0 ;
		for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0 ;
		for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0 ;
		for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		}
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int count = 0 ; count 0 for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		} int i = 1 ; int i = 1 ; i 1 i <= n i n i++ i++ i {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		} {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		} String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			} s.length() % 2 != 0 s.length() % 2 s.length() s.length s 2 0 {
				count++;
			} count++ count {
				i = (i*10)-1 ;
			} i = (i*10)-1 i (i*10)-1 (i*10) i 10 1 System.out.println(count) System.out.println System.out System System.out count String[]args args
import java.util.Scanner;

 class Main {
	public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count = 0 ;
		for(int i = 1 ; i <= n ; i++) {
			String s = Integer.toString(i);
			if(s.length() % 2 != 0) {
				count++;
			}else {
				i = (i*10)-1 ;
			}
		}
		System.out.println(count);
	}
}
