N,K = map(int,input().split()) if K == 1: print(pow(2,N-K)-N) else: print(pow(2,N-K))