import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int count = 0; count 0 for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        } {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        } if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            } String.valueOf(i).length() == 1 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 1 {
                count++;
            } count++ count if (String.valueOf(i).length() % 2 != 0) {
                count++;
            } String.valueOf(i).length() % 2 != 0 String.valueOf(i).length() % 2 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i 2 0 {
                count++;
            } count++ count PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(count) out.println out count out.flush() out.flush out sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    }
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int count = 0;

        for (int i = 1; i <= N; i++) {
            if (String.valueOf(i).length() == 1) {
                count++;
            } else if (String.valueOf(i).length() % 2 != 0) {
                count++;
            }
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(count);
        out.flush();
        sc.close();
    }
}