#include <bits/stdc++.h>
using namespace std;

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