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