#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int func( int a ) { if ( a == 1 ) { return 0; } int ret = 0; for ( int i = 2; i <= a; i++ ) { ret += 1<<(a-i); } ret += func( a-1 ); return ret; } int main() { int N,K; cin >> N >> K; if ( K == 1 ) { cout << func(N-1) << endl; } else { cout << (1<<(N-K)) << endl; } return 0; }