import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	}
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	}
} Main public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	} main {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	} 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+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		} int i=1; int i=1; i 1 i<N+1 i N+1 N 1 i++ i++ i {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		} {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		} String I = Integer.toString(i); I Integer.toString(i) Integer.toString Integer i int length = I.length(); length I.length() I.length I if(length%2==1) {
				ans++;
			} length%2==1 length%2 length 2 1 {
				ans++;
			} ans++ ans 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) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	}
} public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	}
} Main
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();
		int ans = 0;
		for(int i=1;i<N+1;i++) {
			String I = Integer.toString(i);
			int length = I.length();
			if(length%2==1) {
				ans++;
			}
		}
		System.out.println(ans);


	}
}
