n, k = map(int, input().split()) if k == 1: print(2 ** (n - k) - n) else: print(2 ** (n - k))