#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
#define N 310
ll n,k;
bool solve(ll x){
    ll sum=0;
    for(int i=0;i<n;i++){
	sum+=x;
	x/=2;
	if(x==0)break;
    }
    return sum<=k;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin>>n>>k;
    ll l=0,r=1e18,mid;
    while(l<r-1){
	mid=(l+r)>>1;
	if(solve(mid))l=mid;
	else r=mid;
    }
    cout<<l<<endl;
}



