#include using namespace std; int main() { int N, M; cin >> N >> M; long long ans = 0; int i = 0; for (i = 0; i < N && M != 1; ++i) { ans += M; M = (M + 1) / 2; } if(i == N && M != 1) { cout << ((1<