def get(): return list(map(int, input().strip().split(' '))) N, K = get() x = 1 << (N - K) if K == 1: x -= N print(x)