import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	} 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 r = 0; r 0 for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		} {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		} int l = String.valueOf(i).length(); l String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i if(l % 2 != 0) r++; l % 2 != 0 l % 2 l 2 0 r++ r System.out.println(r) System.out.println System.out System System.out r String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int r = 0;
		for(int i = 1; i <= N; i++) {
			int l = String.valueOf(i).length();
			if(l % 2 != 0) r++;
		}
		System.out.println(r);
	}
}
