import java.util.Scanner;
class Main{


	static char[][] map;
	static final int MOD = 1000000007;


	static long[][] c;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int a = sc.nextInt();
		int ans = 0;
		for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);




	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



	static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	}




}



class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}








}



 import java.util.Scanner; Scanner java.util class Main{


	static char[][] map;
	static final int MOD = 1000000007;


	static long[][] c;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int a = sc.nextInt();
		int ans = 0;
		for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);




	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



	static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	}




} Main static char[][] map; map static final int MOD = 1000000007; MOD 1000000007 static long[][] c; c public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int a = sc.nextInt();
		int ans = 0;
		for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);




	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int a = sc.nextInt();
		int ans = 0;
		for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);




	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		} int i = 1; int i = 1; i 1 i <= a i a i++ i++ i {
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		} {
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		} if(String.valueOf(i).length() % 2 == 1){
				ans++;
			} String.valueOf(i).length() % 2 == 1 String.valueOf(i).length() % 2 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 2 1 {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} gcd {				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		} b == 0 b 0 {
			return a;
		} return a; a {
			return gcd(b, a%b);
		} return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} gcd {
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		} b == 0 b 0 {
			return a;
		} return a; a {
			return gcd(b, a%b);
		} return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b long a a long b b static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	} lcm {
		long g = gcd(a,b);
		return a/g*b;
	} long g = gcd(a,b); g gcd(a,b) gcd a b return a/g*b; a/g*b a/g a g b long a a long b b class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}








} Pair int from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	} compareTo {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return   end- otherpair.end; end- otherpair.end end otherpair.end otherpair otherpair.end Object other other Comparable
import java.util.Scanner;
class Main{


	static char[][] map;
	static final int MOD = 1000000007;


	static long[][] c;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int a = sc.nextInt();
		int ans = 0;
		for(int i = 1;i <= a;i++){
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);




	}



	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	static long gcd(long a,long b){
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}



	static long lcm (long a, long b) {
		long g = gcd(a,b);
		return a/g*b;
	}




}



class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return   end- otherpair.end;
	}








}




