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