import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,K = map(int,read().split()) if K >= 2: answer = 2**(N-K) else: answer = 2**(N-K) - N print(answer)