main(N,K){scanf("%d%d", &N,&K);printf("%d\n",(int)pow(2,N-K)-1/K*N);}