import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int len = String.valueOf(n).length(); len String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n int c = 0; c 0 for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		} int i = 1; int i = 1; i 1 i <= len i len i += 2 i += 2 i 2 {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		} {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		} if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			} i < len i len {
				c += (int)Math.pow(10, i - 1) * 9;
			} c += (int)Math.pow(10, i - 1) * 9 c (int)Math.pow(10, i - 1) * 9 (int)Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 9 {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			} if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1; i == 1 i 1 c += n c n c += n - (int)Math.pow(10, i - 1) + 1 c n - (int)Math.pow(10, i - 1) + 1 n - (int)Math.pow(10, i - 1) n (int)Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 1 System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int len = String.valueOf(n).length();
		int c = 0;

		for(int i = 1; i <= len; i += 2) {
			if(i < len) {
				c += (int)Math.pow(10, i - 1) * 9;
			} else {
				if(i == 1) c += n;
				else c += n - (int)Math.pow(10, i - 1) + 1;
			}
		}
		System.out.println(c);
	}
}