# -*- coding: utf-8 -*- import itertools N,K = map(int, input().split()) A = list(range(1,N+1)) if K > 1: print(2**(N-K)) else: print(2**(N-K)-N)