#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll n,k;
bool check(ll mid){
  ll sum=mid;
  ll num=mid;
  ll cnt=1;
  while(num>0&&cnt<n){
    cnt++;
    sum+=num/2;
    num/=2;
  }
  // cout<<sum<<endl;
  if(sum<=k)return true;
  else return false;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>k;
  ll le=1,ri=k+1;
  while(ri-le>1){
    ll mid=(le+ri)/2;
    if(check(mid)){
      le=mid;
    }else ri=mid;
  }
  cout<<le<<endl;
  return 0;
}

