import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    } main {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int total = 0; total 0 for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        } {
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        } int numOfdigits = String.valueOf( i ).length(); numOfdigits String.valueOf( i ).length() String.valueOf( i ).length String.valueOf( i ) String.valueOf String i if (numOfdigits % 2 == 1){
                total++;
            } numOfdigits % 2 == 1 numOfdigits % 2 numOfdigits 2 1 {
                total++;
            } total++ total System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        int total = 0;
        for(int i = 1; i <= N; i++){
            int numOfdigits = String.valueOf( i ).length();
            if (numOfdigits % 2 == 1){
                total++;
            }
        }
        
        System.out.println(total);
    }
}
