import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int l = String.valueOf(N).length(); l String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N double ans = 0; ans 0 if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		} l/2 == 3 l/2 l 2 3 {
			ans += 90909;
		} ans += 90909 ans 90909 if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		} l/2 == 2 l/2 l 2 2 {
			ans += 909;
		} ans += 909 ans 909 if(l/2 == 1){
			ans += 9;
		} l/2 == 1 l/2 l 2 1 {
			ans += 9;
		} ans += 9 ans 9 if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		} l%2 == 1 l%2 l 2 1 {
			ans += N - Math.pow(10, l-1) + 1;
		} ans += N - Math.pow(10, l-1) + 1 ans N - Math.pow(10, l-1) + 1 N - Math.pow(10, l-1) N Math.pow(10, l-1) Math.pow Math 10 l-1 l 1 1 System.out.println((int)ans) System.out.println System.out System System.out (int)ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int l = String.valueOf(N).length();
		double ans = 0;
		if(l/2 == 3) {
			ans += 90909;
		}else if(l/2 == 2) {
			ans += 909;
		}else if(l/2 == 1){
			ans += 9;
		}
		if(l%2 == 1) {
			ans += N - Math.pow(10, l-1) + 1;
		}
		
		System.out.println((int)ans);
	}
}