import java.io.PrintWriter;
import java.util.Scanner;

public class Main{

	public static void main(String[] args){
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} import java.io.PrintWriter; PrintWriter java.io 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();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} Main public static void main(String[] args){
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	} main {
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.close() sc.close sc int ans = 0; ans 0 for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		} {
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		} String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i if(s.length() % 2 == 1) ans++; s.length() % 2 == 1 s.length() % 2 s.length() s.length s 2 1 ans++ ans PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(ans) out.println out ans out.flush() out.flush out String[] args args public class Main{

	public static void main(String[] args){
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} public class Main{

	public static void main(String[] args){
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{

	public static void main(String[] args){
		//入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();

		//処理
		int ans = 0;
		for(int i = 1; i <= n; i++){
			String s = Integer.toString(i);
			if(s.length() % 2 == 1) ans++;
		}
		
		//出力
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
}