int find_number(int MAX) {
        int l = 0;
        int r = MAX + 1;
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (smaller(m)) {
                r = m;
            } else {
                l = m;
            }
        }
        return l;
    }