N,K=map(int,input().split()) ans=0 P=0 X=K if 2**(N-1)<=K: for i in range(N): ans+=2**i print(ans) else: while P