

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	}

} 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 answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int answer = 0; answer 0 int max5 = 90000; max5 90000 int max3 = 900; max3 900 int max1 = 9; max1 9 if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		} n >= 10000 n 10000 {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		} if (n > 99999)
				answer += max5;
			else
				answer += n - 9999; n > 99999 n 99999 answer += max5 answer max5 answer += n - 9999 answer n - 9999 n 9999 if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		} n >= 100 n 100 {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		} if (n > 999)
				answer += max3;
			else
				answer += n - 99; n > 999 n 999 answer += max3 answer max3 answer += n - 99 answer n - 99 n 99 if (n >= 10)
			answer += max1;
		else
			answer += n; n >= 10 n 10 answer += max1 answer max1 answer += n answer n System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	}

} 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 answer = 0;
		int max5 = 90000;
		int max3 = 900;
		int max1 = 9;

		if (n >= 10000) {
			if (n > 99999)
				answer += max5;
			else
				answer += n - 9999;

		}
		if (n >= 100) {
			if (n > 999)
				answer += max3;
			else
				answer += n - 99;
		}

		if (n >= 10)
			answer += max1;
		else
			answer += n;

		System.out.println(answer);

	}

}
