#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

int main(void) {
    int N, K;
    cin >> N >> K;

    int ans = 0, y;
    int max = pow(2, N);
    for(int x=1; x <= max; x++){
        y = pow(2, K);
        if(x % y == 0)  ans++;
    }
    cout << ans << endl;
}