import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		}
		System.out.print(ans);
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		}
		System.out.print(ans);
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		}
		System.out.print(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		}
		System.out.print(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		} {
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		} int tmp = i; tmp i int cnt = 0; cnt 0 for(;tmp != 0;){
				tmp/=10;
				cnt++;
			} ; tmp != 0 tmp 0 {
				tmp/=10;
				cnt++;
			} {
				tmp/=10;
				cnt++;
			} tmp/=10 tmp 10 cnt++ cnt if(cnt%2==1){
				ans++;
			} cnt%2==1 cnt%2 cnt 2 1 {
				ans++;
			} ans++ ans System.out.print(ans) System.out.print System.out System System.out ans String args[] args
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for(int i = 1; i <= n; i++){
			int tmp = i;
			int cnt = 0;
			for(;tmp != 0;){
				tmp/=10;
				cnt++;
			}
			if(cnt%2==1){
				ans++;
			}
		}
		System.out.print(ans);
	}
}
