import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		System.out.println(search(N));
	}

	public static int search(int N) {
		int ans = 0;

		for(int n = 1; n <= N; n++) {
			if (Integer.toString(n).length() % 2 == 0) continue;
			ans++;
		}
		return 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();
		System.out.println(search(N));
	}

	public static int search(int N) {
		int ans = 0;

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

		for(int n = 1; n <= N; n++) {
			if (Integer.toString(n).length() % 2 == 0) continue;
			ans++;
		}
		return ans;
	} search {
		int ans = 0;

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

	public static int search(int N) {
		int ans = 0;

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

	public static int search(int N) {
		int ans = 0;

		for(int n = 1; n <= N; n++) {
			if (Integer.toString(n).length() % 2 == 0) continue;
			ans++;
		}
		return 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();
		System.out.println(search(N));
	}

	public static int search(int N) {
		int ans = 0;

		for(int n = 1; n <= N; n++) {
			if (Integer.toString(n).length() % 2 == 0) continue;
			ans++;
		}
		return ans;
	}
}
