import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
} Main public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	} main {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int N = stdIn.nextInt(); N stdIn.nextInt() stdIn.nextInt stdIn int ans = 0; ans 0 for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		} int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		} {
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		} if(i < 10){
				ans++;
			} i < 10 i 10 {
				ans++;
			} ans++ ans if(100 <= i && i < 1000){
				ans++;
			} 100 <= i && i < 1000 100 <= i 100 i i < 1000 i 1000 {
				ans++;
			} ans++ ans if(10000 <= i && i < 100000){
				ans++;
			} 10000 <= i && i < 100000 10000 <= i 10000 i i < 100000 i 100000 {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans stdIn.close() stdIn.close stdIn String[] args args public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int ans = 0;
		for(int i = 1; i < N + 1; i++){
			if(i < 10){
				ans++;
			}
			if(100 <= i && i < 1000){
				ans++;
			}
			if(10000 <= i && i < 100000){
				ans++;
			}
		}
		System.out.println(ans);
		stdIn.close();
	}
}
