

import java.util.InputMismatchException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	}


	public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	}

}
 import java.util.InputMismatchException; InputMismatchException java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	}


	public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	}

} Main public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	} main {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	} try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		} InputMismatchException e {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		} System.out.println("整数を入力してください") System.out.println System.out System System.out "整数を入力してください" {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner Main testB = new Main(); testB new Main() System.out.println(testB.unevenNumbers(n)) System.out.println System.out System System.out testB.unevenNumbers(n) testB.unevenNumbers testB n scanner.close() scanner.close scanner String[] args args public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	} unevenNumbers {
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	} if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		} n < 10 n 10 {
			return n;
		} return n; n if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		} n < 100 n 100 {
			return 9;
		} return 9; 9 if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		} n < 1000 n 1000 {
			return n - 90;
		} return n - 90; n - 90 n 90 if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		} n < 10000 n 10000 {
			return 909;
		} return 909; 909 if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		} n < 100000 n 100000 {
			return n - 9090;
		} return n - 9090; n - 9090 n 9090 {
			return 90909;
		} return 90909; 90909 int n n public class Main {

	public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	}


	public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	}

} public class Main {

	public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	}


	public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	}

} Main


import java.util.InputMismatchException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try {
			Scanner scanner = new Scanner(System.in);
			int n = scanner.nextInt();

			Main testB = new Main();
			System.out.println(testB.unevenNumbers(n));

			scanner.close();

		} catch (InputMismatchException e) {
			// TODO: handle exception
			System.out.println("整数を入力してください");
		}
	}


	public int unevenNumbers(int n){
		if (n < 10) {
			return n;
		} else if (n < 100){
			return 9;
		} else if (n < 1000) {
			return n - 90;
		} else if (n < 10000) {
			return 909;
		} else if (n < 100000) {
			return n - 9090;
		} else {
			return 90909;
		}
	}

}

