N,K=int(eval(input())),int(eval(input()))



ans=10**10

for i in range(2**N):

  tmp=1

  for j in range(N):

    if (i>>(N-j-1)&1)==1:

      tmp*=2

    else:

      tmp+=K

  ans=min(ans,tmp)

print(ans)
N,K=int(eval(input())),int(eval(input()))



M=[0]*(N+1)

M[0]=1



for i in range(1,N+1):

  M[i]=min(M[i-1]*2,M[i-1]+K)

print((M[N]))
N, K = int(eval(input())), int(eval(input()))
ans = 10**10
for i in range(2**N):
    tmp = 1
    for j in range(N):
        if (i >> (N - j - 1) & 1) == 1:
            tmp *= 2
        else:
            tmp += K
    ans = min(ans, tmp)
print(ans)

N, K = int(eval(input())), int(eval(input()))
M = [0] * (N + 1)
M[0] = 1
for i in range(1, N + 1):
    M[i] = min(M[i - 1] * 2, M[i - 1] + K)
print((M[N]))

-ans = 10**10 -for i in range(2**N): -    tmp = 1 -    for j in range(N): -        if (i >> (N - j - 1) & 1) == 1: -            tmp *= 2 -        else: -            tmp += K -    ans = min(ans, tmp) -print(ans) +M = [0] * (N + 1) +M[0] = 1 +for i in range(1, N + 1): +    M[i] = min(M[i - 1] * 2, M[i - 1] + K) +print((M[N]))