import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int i = 1; i 1 int ans = 0; ans 0 while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		} i <= n i n {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		} String num = Integer.toString(i); num Integer.toString(i) Integer.toString Integer i if(num.length() % 2 == 1) {
				ans++;
			} num.length() % 2 == 1 num.length() % 2 num.length() num.length num 2 1 {
				ans++;
			} ans++ ans i++ i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
}
