import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	}

}
/*
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□■■□□
■■■■■■□□□■□■■■□□□
□□□□□■□□□■■■□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□■■■□□□■□□□□□□□
□■■■□■□□□■□□□□□■□
■■□□□■□□□■■□□□■■□
□□□□□■□□□□■■■■■□□
□□□□□■□□□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
■■■■■■■■■■■■■■■■□
□□□□□□□■□□□□□□□□□
□□□□□□■■■□□□□□□□□
□□□□□□■□■□□□□□□□□
□□□□□□■□■■□□□□□□□
□□□□□■■□□■□□□□□□□
□□□□□■□□□■■□□□□□□
□□□□■■□□□□■■□□□□□
□□□■■□□□□□□■■□□□□
□□■■□□□□□□□□■■□□□
■■■□□□□□□□□□□■■■□
*/ import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	}

} Main public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int result = 0; result 0 for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		} {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		} if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			} (int)Math.floor(Math.log10(i) + 1) % 2 == 1 (int)Math.floor(Math.log10(i) + 1) % 2 (int)Math.floor(Math.log10(i) + 1) Math.floor Math Math.log10(i) + 1 Math.log10(i) Math.log10 Math i 1 2 1 {
				result++;
			} result++ result System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	}

} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 0;
		for(int i = 1; i <= N; i++) {
			if((int)Math.floor(Math.log10(i) + 1) % 2 == 1) {
				result++;
			}
		}
		System.out.println(result);
		sc.close();
	}

}
/*
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□■■□□
■■■■■■□□□■□■■■□□□
□□□□□■□□□■■■□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□□□■□□□■□□□□□□□
□□□■■■□□□■□□□□□□□
□■■■□■□□□■□□□□□■□
■■□□□■□□□■■□□□■■□
□□□□□■□□□□■■■■■□□
□□□□□■□□□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
□□□□□□□■□□□□□□□□□
■■■■■■■■■■■■■■■■□
□□□□□□□■□□□□□□□□□
□□□□□□■■■□□□□□□□□
□□□□□□■□■□□□□□□□□
□□□□□□■□■■□□□□□□□
□□□□□■■□□■□□□□□□□
□□□□□■□□□■■□□□□□□
□□□□■■□□□□■■□□□□□
□□□■■□□□□□□■■□□□□
□□■■□□□□□□□□■■□□□
■■■□□□□□□□□□□■■■□
*/