#include using namespace std; int main() { int N, M; cin >> N >> M; long long ans = 0; for (int i = 0; i < N; ++i) { ans += M; M = (M + 1) / 2; } cout << ans << endl; }