import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

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

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	} main {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) String n = s.next(); n s.next() s.next s int b = Integer.parseInt(n); b Integer.parseInt(n) Integer.parseInt Integer n int c = 0; c 0 for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		} Integer i = 1; Integer i = 1; i 1 i <= b i b i++ i++ i {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		} {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		} if(i.toString().length() % 2 == 1) {
				c++;
			} i.toString().length() % 2 == 1 i.toString().length() % 2 i.toString().length() i.toString().length i.toString() i.toString i 2 1 {
				c++;
			} c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String n = s.next();
		int b = Integer.parseInt(n);
		int c = 0;
		for (Integer i = 1; i <= b; i++) {
			if(i.toString().length() % 2 == 1) {
				c++;
			}
		}
		System.out.println(c);
	}

}
