import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		}
		System.out.println(count);
		
	}
	
	public static boolean isOddDigit(int a){
		int num = a, count1 = 0;
		while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		}
		if(count1 % 2 != 0){
			return true;
		}
		return false;
	}

	} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		}
		System.out.println(count);
		
	}
	
	public static boolean isOddDigit(int a){
		int num = a, count1 = 0;
		while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		}
		if(count1 % 2 != 0){
			return true;
		}
		return false;
	}

	} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		}
		System.out.println(count);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		}
		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 count = 0; count 0 for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			if(isOddDigit(i)){
				count++;
			}
		} {
			if(isOddDigit(i)){
				count++;
			}
		} if(isOddDigit(i)){
				count++;
			} isOddDigit(i) isOddDigit i {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isOddDigit(int a){
		int num = a, count1 = 0;
		while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		}
		if(count1 % 2 != 0){
			return true;
		}
		return false;
	} isOddDigit {
		int num = a, count1 = 0;
		while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		}
		if(count1 % 2 != 0){
			return true;
		}
		return false;
	} int num = a num a count1 = 0; count1 0 while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		} a != 0 a 0 {
			int rem = a % 10;
			count1++;
			a /= 10;
		} int rem = a % 10; rem a % 10 a 10 count1++ count1 a /= 10 a 10 if(count1 % 2 != 0){
			return true;
		} count1 % 2 != 0 count1 % 2 count1 2 0 {
			return true;
		} return true; true return false; false int a a
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i = 1; i <= n; i++){
			if(isOddDigit(i)){
				count++;
			}
		}
		System.out.println(count);
		
	}
	
	public static boolean isOddDigit(int a){
		int num = a, count1 = 0;
		while(a != 0){
			int rem = a % 10;
			count1++;
			a /= 10;
		}
		if(count1 % 2 != 0){
			return true;
		}
		return false;
	}

	}