import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
} import java.util.Scanner; Scanner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    } main {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str  = sc.nextLine(); str sc.nextLine() sc.nextLine sc int n = Integer.parseInt(str); n Integer.parseInt(str) Integer.parseInt Integer str sc.close() sc.close sc int flag =0; flag 0 for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            flag += check(Integer.toString(i));
        } {
            flag += check(Integer.toString(i));
        } flag += check(Integer.toString(i)) flag check(Integer.toString(i)) check Integer.toString(i) Integer.toString Integer i System.out.println(flag) System.out.println System.out System System.out flag String[] args args public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    } check {
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    } String[] tmp = a.split(""); tmp a.split("") a.split a "" if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        } tmp.length %2 == 0 tmp.length %2 tmp.length tmp tmp.length 2 0 {
            return  0;
        } return  0; 0 {
            return 1;
        } return 1; 1 String a a public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
} Main
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
}