N, M = map(int, input().split()) ans = M curr = M for i in range(N-1, 0, -1): if curr % 2 == 1: curr += 1 curr //= 2 else: curr //= 2 ans += curr print (ans)