import java.util.Scanner;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int n = (String.valueOf(N)).length();

	int count = 0;
	int x = 10;
	int i;
	for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	}
	if ((i % 2) == 1)
	    count += N - (x / 10) + 1;

	System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int n = (String.valueOf(N)).length();

	int count = 0;
	int x = 10;
	int i;
	for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	}
	if ((i % 2) == 1)
	    count += N - (x / 10) + 1;

	System.out.println(count);
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int n = (String.valueOf(N)).length();

	int count = 0;
	int x = 10;
	int i;
	for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	}
	if ((i % 2) == 1)
	    count += N - (x / 10) + 1;

	System.out.println(count);
    } main {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int n = (String.valueOf(N)).length();

	int count = 0;
	int x = 10;
	int i;
	for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	}
	if ((i % 2) == 1)
	    count += N - (x / 10) + 1;

	System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int n = (String.valueOf(N)).length(); n (String.valueOf(N)).length() (String.valueOf(N)).length (String.valueOf(N)) String.valueOf String N int count = 0; count 0 int x = 10; x 10 int i; i for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	} i = 1; i = 1 i 1 i < n i n i++, x *= 10 i++ i x *= 10 x 10 {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	} {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	} if ((i % 2) == 1) 
		count += x - (x / 10); (i % 2) == 1 (i % 2) i 2 1 count += x - (x / 10) count x - (x / 10) x (x / 10) x 10 if ((i % 2) == 1)
	    count += N - (x / 10) + 1; (i % 2) == 1 (i % 2) i 2 1 count += N - (x / 10) + 1 count N - (x / 10) + 1 N - (x / 10) N (x / 10) x 10 1 System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int n = (String.valueOf(N)).length();

	int count = 0;
	int x = 10;
	int i;
	for (i = 1; i < n; i++, x *= 10) {
	    if ((i % 2) == 1) 
		count += x - (x / 10);
	}
	if ((i % 2) == 1)
	    count += N - (x / 10) + 1;

	System.out.println(count);
    }
}