#coding: utf-8 #yuki_411 n,k=map(int,raw_input().split()) if k==1: res=2**(n-k)-n else: res=2**(n-k) print res