import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    }
} 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();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    }
} Main public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    } main {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int length = String.valueOf(n).length(); length String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n int result = 0; result 0 for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	} int i = length; int i = length; i length i > 0 i 0 i-- i-- i {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	} {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	} if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    } i % 2 == 0 i % 2 i 2 0 {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    } result += Math.pow(10, i - 1) - Math.pow(10, i - 2) result Math.pow(10, i - 1) - Math.pow(10, i - 2) Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 Math.pow(10, i - 2) Math.pow Math 10 i - 2 i 2 i-- i {
		result += n - Math.pow(10, i - 1) + 1;
	    } result += n - Math.pow(10, i - 1) + 1 result n - Math.pow(10, i - 1) + 1 n - Math.pow(10, i - 1) n Math.pow(10, i - 1) Math.pow Math 10 i - 1 i 1 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = scan.nextInt();
	int length = String.valueOf(n).length();
	
	int result = 0;
	for (int i = length; i > 0; i--) {
	    if(i % 2 == 0) {
		result += Math.pow(10, i - 1) - Math.pow(10, i - 2);
		i--;
	    }
	    else {
		result += n - Math.pow(10, i - 1) + 1;
	    }
	}
	
	System.out.println(result);
    }
}
