import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    }
    
    public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    }
    
    public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc System.out.println(answer(n)) System.out.println System.out System System.out answer(n) answer n String[] args args public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    } answer {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    } int count =0; count 0 for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        } {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        } int digits = (int)Math.log10(i)+1; digits (int)Math.log10(i)+1 (int)Math.log10(i) Math.log10 Math i 1 if(digits%2 != 0) {
                count+=1;
            } digits%2 != 0 digits%2 digits 2 0 {
                count+=1;
            } count+=1 count 1 return count; count int n n public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    }
    
    public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    }
    
    public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(answer(n));
    }
    
    public static int answer(int n) {
        int count =0;
        for (int i=1; i<=n; i++) {
            int digits = (int)Math.log10(i)+1; //if 10 or 20
            if(digits%2 != 0) {
                count+=1;
            }
        }
        return count;
    }
}