import java.util.*;

public class Main{
		
		public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		}
		
		
		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(func(i)){
				
					count++;
				
				}
			
			}
			
			System.out.println(count);
			
		}
} import java.util.*; util.* java public class Main{
		
		public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		}
		
		
		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(func(i)){
				
					count++;
				
				}
			
			}
			
			System.out.println(count);
			
		}
} Main public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		} func {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		} int count = 0; count 0 while(n != 0) {
				
				n = n/10;
				count++;
			
			} n != 0 n 0 {
				
				n = n/10;
				count++;
			
			} n = n/10 n n/10 n 10 count++ count if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			} count % 2 == 1 count % 2 count 2 1 {
				
				return true;
				
			} return true; true {
				
				return false;
				
			} return false; false int n n 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(func(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(func(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(func(i)){
				
					count++;
				
				}
			
			} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			
			if(func(i)){
				
					count++;
				
				}
			
			} {
			
			if(func(i)){
				
					count++;
				
				}
			
			} if(func(i)){
				
					count++;
				
				} func(i) func i {
				
					count++;
				
				} count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main{
		
		public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		}
		
		
		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(func(i)){
				
					count++;
				
				}
			
			}
			
			System.out.println(count);
			
		}
} public class Main{
		
		public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		}
		
		
		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(func(i)){
				
					count++;
				
				}
			
			}
			
			System.out.println(count);
			
		}
} Main
import java.util.*;

public class Main{
		
		public static boolean func(int n) {
			
			int count = 0;
			while(n != 0) {
				
				n = n/10;
				count++;
			
			}
			
			if(count % 2 == 1){
				
				return true;
				
			} else {
				
				return false;
				
			}
			
		}
		
		
		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(func(i)){
				
					count++;
				
				}
			
			}
			
			System.out.println(count);
			
		}
}