#include void run(void){ int N,K; scanf("%d%d",&N,&K); if(K==1){ printf("%d\n",(1<<(N-1))-N); } else { printf("%d\n",(1<<(N-K))); } return; } int main(void){ run(); return 0; }