
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		Integer N = sc.nextInt();
		int ans = 0;
		for (Integer i = 1; i <= N; i++) {
			if (i.toString().length() % 2 != 0)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

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

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		Integer N = sc.nextInt();
		int ans = 0;
		for (Integer i = 1; i <= N; i++) {
			if (i.toString().length() % 2 != 0)
				ans++;
		}
		System.out.println(ans);
		sc.close();
	}
}