#include <stdio.h>
 
int main() {
    
	int N=0, K= 0, z= 1;
	scanf("%d\n%d", &N, &K);
	for (int i = 0; i < N; i++) {
		if (2 * z <= z + K) {
			z *= 2;
		} else {
			z += K;
		}
	}
 
	printf("%d\n", z);
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll n, k;
  cin >> n >> k;
  cout << n - k + 1 << endl;
}