import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), k = sc.nextInt(), ans = 1; for(int i = k+1; i <= n; i++){ ans *= 2; } if(k == 1){ ans-=n; } System.out.println(ans); } }