import java.util.*;
import java.util.stream.*;

public class Main {
	Scanner sc;
	int N;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} import java.util.*; util.* java import java.util.stream.*; stream.* java.util public class Main {
	Scanner sc;
	int N;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} Main Scanner sc; sc int N; N //=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	} Main {
		sc = new Scanner(System.in);
	} sc = new Scanner(System.in) sc new Scanner(System.in) /**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	} calc {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	} N = sc.nextInt() N sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		} {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		} int digits = 1 + (int)Math.log10(i); digits 1 + (int)Math.log10(i) 1 (int)Math.log10(i) Math.log10 Math i if (digits % 2 == 1) count++; digits % 2 == 1 digits % 2 digits 2 1 count++ count out(count) out count private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	} out {
		System.out.println(o);
		System.out.flush();
	} System.out.println(o) System.out.println System.out System System.out o System.out.flush() System.out.flush System.out System System.out Object o o //======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	} main {
		Main m = new Main();
		m.calc();
	} Main m = new Main(); m new Main() m.calc() m.calc m String[] args args public class Main {
	Scanner sc;
	int N;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} public class Main {
	Scanner sc;
	int N;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

} Main
import java.util.*;
import java.util.stream.*;

public class Main {
	Scanner sc;
	int N;
	
//=============
// constructor
//
	public Main() {
		sc = new Scanner(System.in);
	}
	
//==================
// instance methods
//
	/**
	 * アルゴリズム本体
	 */
	private void calc() {
		N = sc.nextInt();
		
		int count = 0;
		for (int i = 1; i <= N; i++) {
			int digits = 1 + (int)Math.log10(i);
			if (digits % 2 == 1) count++;
		}
		out(count);
	}
	
	private void out(Object o) {
		System.out.println(o);
		System.out.flush();
	}
	
//======
// main
//
	public static void main(String[] args) {
		Main m = new Main();
		m.calc();
	}

}