import java.util.*;
import static java.lang.System.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	}
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int keta = 0; keta 0 int num = n; num n int ans = 0; ans 0 while (num > 0) {
			num /= 10;
			keta++;
		} num > 0 num 0 {
			num /= 10;
			keta++;
		} num /= 10 num 10 keta++ keta for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		} int i = 1; int i = 1; i 1 i < keta i keta i = i + 2 i = i + 2 i i + 2 i 2 {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		} {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		} int x = 1; x 1 for(int j = 0; j < i; j++) {
				x *=10;
			} int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
				x *=10;
			} {
				x *=10;
			} x *=10 x 10 ans = ans + (x - (x / 10)) ans ans + (x - (x / 10)) ans (x - (x / 10)) x (x / 10) x 10 if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		} keta % 2 == 1 keta % 2 keta 2 1 {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		} int x = 1; x 1 for(int i = 1; i < keta; i++)
				x *= 10; int i = 1; int i = 1; i 1 i < keta i keta i++ i++ i x *= 10; x *= 10 x 10 ans = ans + ( n - x) + 1 ans ans + ( n - x) + 1 ans + ( n - x) + 1 ans ( n - x) n x 1 out.println(ans) out.println out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	}
} Main
import java.util.*;
import static java.lang.System.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int keta = 0;
		int num = n;
		int ans = 0;
		while (num > 0) {
			num /= 10;
			keta++;
		}
		for(int i = 1; i < keta; i = i + 2) {
			int x = 1;
			for(int j = 0; j < i; j++) {
				x *=10;
			}
			ans = ans + (x - (x / 10));
		}
		if (keta % 2 == 1) {
			int x = 1;
			for(int i = 1; i < keta; i++)
				x *= 10;
			ans = ans + ( n - x) + 1;
		}
		out.println(ans);

	}
}