#include using namespace std; int main(){ int N, K; cin >> N >> K; cout << (K==1?pow(2,(N-K))-N:pow(2,(N-K))) << endl; return 0; }