#include using namespace std; using ll = long long; int main(){ ll n,q; cin>>n>>q; while(q--){ ll s,t; cin>>s>>t; ll ans = 0; if(s==0){ ll now = 1; while(now<=t) now <<= 1; now >>= 1; s = now; ans++; } //cout<<(ll)(s&-s)<>= 1; } } cout<