#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,t; cin>>n>>t; map dp; dp[t] = 0; for(int i = 0;i>a; map ndp; for(auto&itr:dp){ int nxt = itr.first & a; ndp[nxt] = max(ndp[nxt],itr.second+abs(nxt-itr.first)); nxt = itr.first | a; ndp[nxt] = max(ndp[nxt],itr.second+abs(nxt-itr.first)); } swap(ndp,dp); } ll ans = 0; for(auto&itr:dp) ans = max(ans,itr.second); cout<