
import java.util.Scanner;

public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
} Main public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int res = 0; res 0 for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        } int i = 1; int i = 1; i 1 i <= n i n ++i ++i i {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        } {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        } if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            } i < 10 i 10 {
                res++;
            } res++ res if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            } i >= 100 && i < 1000 i >= 100 i 100 i < 1000 i 1000 {
                res++;
            } res++ res if (i >= 10000 && i < 100000) {
                ++res;
            } i >= 10000 && i < 100000 i >= 10000 i 10000 i < 100000 i 100000 {
                ++res;
            } ++res res System.out.println(res) System.out.println System.out System System.out res String []args args public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
} public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String []args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 1; i <= n; ++i) {
            if (i < 10) {
                res++;
            } else if (i >= 100 && i < 1000) {
                res++;
            } else if (i >= 10000 && i < 100000) {
                ++res;
            }
        }
        System.out.println(res);
    }
}
