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

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