import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        } {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int count = 0; count 0 for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            } int n = 1; int n = 1; n 1 n <= N n N n++ n++ n {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            } {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            } int mask = 0; mask 0 if (n / 1 > 0) {
                    mask |= (1 << 0);
                } n / 1 > 0 n / 1 n 1 0 {
                    mask |= (1 << 0);
                } mask |= (1 << 0) mask (1 << 0) 1 0 if (n / 10 > 0) {
                    mask |= (1 << 1);
                } n / 10 > 0 n / 10 n 10 0 {
                    mask |= (1 << 1);
                } mask |= (1 << 1) mask (1 << 1) 1 1 if (n / 100 > 0) {
                    mask |= (1 << 2);
                } n / 100 > 0 n / 100 n 100 0 {
                    mask |= (1 << 2);
                } mask |= (1 << 2) mask (1 << 2) 1 2 if (n / 1000 > 0) {
                    mask |= (1 << 3);
                } n / 1000 > 0 n / 1000 n 1000 0 {
                    mask |= (1 << 3);
                } mask |= (1 << 3) mask (1 << 3) 1 3 if (n / 10000 > 0) {
                    mask |= (1 << 4);
                } n / 10000 > 0 n / 10000 n 10000 0 {
                    mask |= (1 << 4);
                } mask |= (1 << 4) mask (1 << 4) 1 4 if (n / 100000 > 0) {
                    mask |= (1 << 5);
                } n / 100000 > 0 n / 100000 n 100000 0 {
                    mask |= (1 << 5);
                } mask |= (1 << 5) mask (1 << 5) 1 5 if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                } (32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1 (32 - Integer.numberOfLeadingZeros(mask)) % 2 (32 - Integer.numberOfLeadingZeros(mask)) 32 Integer.numberOfLeadingZeros(mask) Integer.numberOfLeadingZeros Integer mask 2 1 {
                    count++;
                } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();

            int count = 0;
            for (int n = 1; n <= N; n++) {
                int mask = 0;
                if (n / 1 > 0) {
                    mask |= (1 << 0);
                }
                if (n / 10 > 0) {
                    mask |= (1 << 1);
                }
                if (n / 100 > 0) {
                    mask |= (1 << 2);
                }
                if (n / 1000 > 0) {
                    mask |= (1 << 3);
                }
                if (n / 10000 > 0) {
                    mask |= (1 << 4);
                }
                if (n / 100000 > 0) {
                    mask |= (1 << 5);
                }

                if ((32 - Integer.numberOfLeadingZeros(mask)) % 2 == 1) {
                    count++;
                }
            }

            System.out.println(count);
        }
    }
}
