Problem:
 Score : 200 points    Problem Statement Square1001 has seen an electric bulletin board displaying the integer 1 .
He can perform the following operations A and B to change this value:   Operation A: The displayed value is doubled.  Operation B: The displayed value increases by K .   Square1001 needs to perform these operations N times in total.
Find the minimum possible value displayed in the board after N operations.      Constraints  1 \leq N, K \leq 10  All input values are integers.         Input Input is given from Standard Input in the following format:  N  K       Output Print the minimum possible value displayed in the board after N operations.        Sample Input 1 4
3      Sample Output 1 10  The value will be minimized when the operations are performed in the following order: A, A, B, B. In this case, the value will change as follows: 1 → 2 → 4 → 7 → 10 .       Sample Input 2 10
10      Sample Output 2 76  The value will be minimized when the operations are performed in the following order: A, A, A, A, B, B, B, B, B, B. In this case, the value will change as follows: 1 → 2 → 4 → 8 → 16 → 26 → 36 → 46 → 56 → 66 → 76 .  By the way, this contest is AtCoder Beginner Contest 076.

Solution (Python):
N = int(input())
K = int(input())

a = 1
for i in range(N):
    if a < K:
        a *= 2
    else:
        a += K
print(a)

Solution (Python):
N = int(input())
K = int(input())
num = 1
for i in range(N):
    num = min(num + K, num * 2)

print(num)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
    a = 2*ans
    b = ans + K
    ans = min(a, b)

print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
  if ans>=k:
    ans+=k
  else:
    ans*=2
print(ans)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K

print(ans)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
for i in range(n):
    ans = min(ans + k, ans * 2)
print(ans)

Solution (Python):
N = int(input())
K = int(input())

best = 10**9
for i in range(2**N):
    v = 1
    for j in range(N):
        if (i >> j) & 1:
            v *= 2
        else:
            v += K
    best = min(best, v)
print(best)

Solution (Python):
n = int(input())
k = int(input())
num = 1
for i in range(n):
    num = min(num + k, num * 2)
print(num)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def POW(x, y):
    if y == 0:
        return 1
    elif y == 1:
        return x
    elif y % 2 == 0:
        return POW(x, y // 2) ** 2 % MOD
    else:
        return POW(x, y // 2) ** 2 * x % MOD
def mod_factorial(x, y): return x * POW(y, MOD - 2) % MOD
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from functools import reduce

def main():
    N = II()
    K = II()
    ans = 1
    for _ in range(N):
        if ans < K:
            ans *= 2
        else:
            ans += K
    return ans

print(main())

Solution (Python):
N=int(input())
K=int(input())
ans=1
for i in range(N):
    if ans>=K:
        ans+=K
    else:
        ans*=2
print(ans)

Solution (Python):
def solve(string):
    n, k = map(int, string.split())
    tmp = 1
    while tmp < k and n > 0:
        tmp <<= 1
        n -= 1
    return str(tmp + n * k)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Solution (Python):
n=int(input())
k=int(input())
ans=1
for _ in range(n):
  if ans<k:
    ans+=ans
  else:
    ans+=k
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1

for i in range(n):
	ans += min(ans, k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())

x = 1
for i in range(N):
    if x+K >= 2*x:
        x = 2*x
    else:
        x = x+K
print(x)

Solution (Python):



N = int(input())
K = int(input())

x = 1
for i in range(N):
    x = min(x * 2, x + K)
print(x)

Solution (Python):
from sys import stdin
n = int(stdin.readline().rstrip())
k = int(stdin.readline().rstrip())
a = 1
for i in range(n):
    if a*2-a > k:
        a+=k
    else:
        a*=2
print(a)

Solution (Python):
N = int(input())
K = int(input())
ans = 1

for i in range(N):
  if ans <= K :
    ans = ans * 2
  else:
    ans = ans + K
print(ans)

Solution (Python):
cnt=0
N=int(input())
K=int(input())
now=1
while cnt<N:
    if now<K:
        now*=2
    else:
        now+=K
    cnt+=1
print(now)

Solution (Python):


n = int(input())
k = int(input())

num = 1

for i in range(n):
    num = min(num*2,num+k)

print(num)

Solution (Python):
N = int(input())
K = int(input())
x = 1

for i in range(N):
    if x + K >= x * 2:
        x *= 2
    else:
        x += K
print(x)

Solution (Python):
n=int(input())
k=int(input())
hoge=1
for i in range(n):
  hoge=min(hoge*2,hoge+k)
print(hoge)

Solution (Python):
n = int(input())
k = int(input())
c = 0
t = 1
while (c < n):
    c += 1
    if (t < k):
        t *= 2
    else:
        t += k
print(t)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
    ans = min(ans * 2, ans + K)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
p = 1
ct = 0
while(ct < N):
    p = min(2*p, p+K)
    ct += 1
print(p)

Solution (Python):
N = int(input())
K = int(input())
min = 99999
display = 1
for i in range(N):
    if display < K:
        display = display * 2
    else:
        display += K
print(display)

Solution (Python):

n = int(input())
k = int(input())
ans = 1
for i in range(n):
    if ans < k:
        ans *= 2
    else:
        ans += k
print(ans)

Solution (Python):

N = int(input())
K = int(input())
ans =1
for i in range(N):
    if ans * 2 < ans+ K:
        ans=2 * ans
    else:
        ans+=K
print(ans)

Solution (Python):


import itertools
import collections
import bisect

def main():
    N = int(input())
    K = int(input())

    val = 1
    for _ in range(N):
        val = min(val * 2, val + K)
    print(val)

if __name__ == '__main__':
    main()

Solution (Python):
n,k,a=int(input()),int(input()),1
for i in range(n):
  if a>k:a+=k
  else:a*=2
print(a)

Solution (Python):
N=int(input())
K=int(input())
num=1
for i in range(N):
    if num>K:
        num+=K
    else:
        num*=2
print(num)

Solution (Python):
N = int(input())
K = int(input())
ret = 1
for _ in range(N):
    if ret * 2 < ret + K:
        ret *= 2
    else:
        ret += K
print(ret)

Solution (Python):
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
K = I()

ans = 1
for i in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K
print(ans)

Solution (Python):
n=int(input())
k=int(input())
l=1
for i in range(n):
    a=[]
    a.append(l*2)
    a.append(l+k)
    l=min(a)
print(l)

Solution (Python):
N = int(input())
K = int(input())

cnt = 1
for i in range(N):
    if cnt * 2 > cnt + K:
        cnt += K
    else:
        cnt *= 2

print(cnt)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
  ans=min(ans*2,ans+k)
print(ans)

Solution (Python):
def addition_and_multiplication(N: int, K: int)->int:
    min_d = float('inf')
    for i in range(1 << N):
        d = 1
        
        
        for _ in range(N):
            if i & 1:
                d = d * 2
            else:
                d = d + K
            i >>= 1
        min_d = min(d, min_d)
    return min_d


if __name__ == "__main__":
    N = int(input())
    K = int(input())
    ans = addition_and_multiplication(N, K)
    print(ans)

Solution (Python):
n = int(input())
k = int(input())
now = 1
for i in range(n):
    if now < k:
        now *= 2
    else:
        now += k
print(now)

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_list_of_int():
    return [int(i) for i in input().split()]


def get_list_of_float():
    return [float(f) for f in input().split()]


def get_list_of_char():
    return list(input().strip())


def get_data(n, order=None, **kwargs):
    if not order:
        order = range(len(kwargs))
    it = iter(order)
    var, fn = zip(*sorted(sorted(kwargs.items()), key=lambda _: next(it)))

    rows = []
    for _ in range(n):
        rows.append(input().split())
    columns = zip(*rows)
    exec("global "+", ".join(var)+"\n"+"\n".join(
        v+"=list(map(fn[{}], data[{}]))".format(i, i)
        for i, v in enumerate(var)),
        globals(),
        {"fn": list(fn), "data": list(columns)}
    )
    return



N, K = 0, 0


def set_inputs():
    global N, K
    N = get_int()
    K = get_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    p = 1
    for i in range(N):
        p = min(p * 2, p + K)
    print(p)
    return


if __name__ == '__main__':
    main()

Solution (Python):
def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

n = int(input())
k = int(input())

ans = 1
for i in range(n):
    if ans >= k:
        ans += k
    else:
        ans = ans * 2
        
print(ans)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
    ans = min(ans * 2, ans + K)

print(ans)

Solution (Python):
N = int(input())
K = int(input())

tmp = 1
for _ in range(N):
  tmp = min(tmp*2,tmp+K)
print(tmp)

Solution (Python):
N = int(input())
K = int(input())
number = 1
for i in range(1, N+1):
    if number * 2 < number + K:
        number = number* 2
    else:
        number = number + K
print(number)

Solution (Python):
n = int(input())
k = int(input())

ans = 1

for i in range(n):
	if 2*ans <= ans + k:
		ans *= 2
	else:
		ans += k
        
print(ans)

Solution (Python):
N=int(input())
K=int(input())
history=[1]
for i in range(N):
  history.append(min(history[-1]*2, history[-1]+K))
print(history[-1])

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    K = int(input())

    ans = 1
    while N > 0:
        if ans >= K:
            break
        ans *= 2
        N -= 1

    ans += K * N
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
K = int(input())
ResMin = float("inf")

for i in range(2**N):
    point = 1
    operate = [1] * N
    for j in range(N):
        if ((i >> j) & 1):
            operate[N - j - 1] = 2
    for k in operate:
        if k == 1:
            point *= 2
        else:
            point += K
    
    if point < ResMin:
        ResMin = point

print(ResMin)

Solution (Python):
n,k=eval('int(input()),'*2);r=1;exec('r+=min(r,k);'*n);print(r)

Solution (Python):
n = int(input())
k = int(input())
num = 1
for _ in range(n):
    num = min(2*num, num + k)
print(num)

Solution (Python):
N = int(input())
K = int(input())
n = 1
for _ in range(N):
    n = min(n * 2, n + K)
print(n)

Solution (Python):
n = int(input())
k = int(input())

result = 1
for i in range(n):
    if result < k:
        result *= 2
    else:
        result += k

print(result)

Solution (Python):
n=int(input())
k=int(input())
a=1
t=0
while t!=n:
    if a*2>a+k:
        a=a+k
    else:
        a=2*a
    t+=1
print(a)

Solution (Python):
n=int(input())
k=int(input())
res=1
for i in range(n):
    if res>k:
        res+=k
        break
    res*=2


res+=k*(n-i-1)

print(res)

Solution (Python):
N = int(input())
K = int(input())
a = 1
for i in range(N):
    if a * 2 < a + K:
        a *= 2
    else:
        a += K
print(a)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import itertools
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return list(sys.stdin.readline())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007


"""
r = I()
g = I()
print(2*g-r)
"""


n = I()
k = I()
ans = 1
for i in range(n):
    ans = min(ans * 2, ans + k)
print(ans)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007


def A():
    r,g = IR(2)
    print(2*g-r)


def B():
    n = I()
    k = I()
    a = 1
    for i in range(n):
        if a > k:
            a += k
        else:
            a *= 2
    print(a)

def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    B()

Solution (Python):
n = int(input())
k = int(input())

ans = 1

for i in range(n):
    if ans * 2 <= ans + k:
        ans = ans * 2
    else:
        ans += k

print(ans)

Solution (Python):
n = int(input())
k = int(input())
board = 1
for i in range(n):
    if board+k < board*2:
        board += k
    else:
        board *= 2
print(board)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    ans = min((ans*2),ans+K)
print(ans)

Solution (Python):
n,k=eval('int(input()),'*2);r=1
for _ in[0]*n:r+=min(r,k)
print(r)

Solution (Python):
n,k=eval('int(input()),'*2);r=1
for _ in[0]*n:r+=min(r,k)
print(r)

Solution (Python):
N = int(input())
K = int(input())
A = 1
for _ in range(N) :
    if A < K :
        A = A * 2
    else :
        A = A + K        
print(A)

Solution (Python):
N = int(input())
K = int(input())
A = 1
for _ in range(N) :
    if A * 2 < A + K :
        A = A * 2
    else :
        A = A + K        
print(A)

Solution (Python):
N = int(input())
K = int(input())
anss = []
for i in range(2**N):
    tmp = 1
    for j in range(N):
        if (i >> j) % 2 == 1:
            tmp *= 2
        else:
            tmp += K
    anss.append(tmp)
print(min(anss))

Solution (Python):
def main():
    N = int(input())
    K = int(input())
    X = 1
    for i in range(N):
        if X + K < X * 2:
            X += K
        else:
            X *= 2
    print(X)


if __name__ == "__main__":
    main()

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

t = 1
N = int(input())
K = int(input())

dp = [0]*(N+1)
dp[0] = 1

for i in range(1, N+1):
    dp[i] = min(dp[i-1]+K, dp[i-1]*2)
print(dp[-1])

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
  ans = min(ans*2, ans+K)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(10):
  ans *= 2
  n -= 1
  if ans >= k or n == 0:
    break
print(ans + k*n)

Solution (Python):
""" AtCoder """

N = int(input())
K = int(input())
ans = 1

for _ in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K

print(ans)

Solution (Python):
N = int(input())
K = int(input())
num = 1
for i in range(N):
    num = min(num * 2, num + K)
print(num)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
while ans <= k and n > 0 :
    ans *= 2
    n -= 1
print(ans + k * n)

Solution (Python):
n = int(input())
k = int(input())
num = 1
for i in range(n):
  if num < k:
    num *= 2
  else:
    num += k
print(num)

Solution (Python):
N = int(input())
K = int(input())
x = 1
for _ in range(N):
    x = min(2*x, x+K)
print(x)

Solution (Python):
N = int(input())
K = int(input())
ans = 1

for i in range(N):
  if(2*ans < ans + K):
    ans = 2*ans
  else:
    ans += K
print(ans)

Solution (Python):
n=int(input())
k=int(input())
a=1
for i in range(n):
    if a<k:a*=2
    else:a+=k
print(a)

Solution (Python):

N = int(input())
K = int(input())
ans = 1
for _ in range(N):
  if ans < K:
    ans *= 2
  else:
    ans += K
print(ans)

Solution (Python):
a=[int(input()) for i in range(2)]
ans=1
for i in range(a[0]):
    ans=min(ans*2,ans+a[1])
print(ans)

Solution (Python):
N = int( input() )
K = int( input() )

ans = 1
num = 0
while num < N:
    if ans < K: ans += ans
    else:       ans += K
    num += 1

print( ans )

Solution (Python):
n,k=[int(input()) for i in range(2)]
ans=1
for i in range(n):
    ans+=min(k,ans)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
count = 1
for i in range(N):
  if count*2 <= count+K:
    count *= 2
  else:
    count += K
print(count)

Solution (Python):
n = int(input())
k = int(input())

ans = 1

for i in range(n):
    if ans < k:
        ans *= 2

    else:
        ans += k
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(ans+k,ans*2)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
res = 10**10
for i in range(1 << n):
    total = 1
    for j in range(n):
        if (i >> j) & 1 == 1:
            total *= 2
        else:
            total += k
    if res > total:
        res = total
print(res)

Solution (Python):
n = int(input())
k = int(input())
s = 1
for i in range(n):
    s = min(s+k,s*2)
print(s)

Solution (Python):
n = int(input())
k = int(input())
a = [1]
for i in range(n):
    if a[i] < k:
        a[i] = 2*a[i]
        a.append(a[i])
    else:
        a[i] = a[i] + k
        a.append(a[i])
print(a[n-1])

Solution (Python):
n, k = [int(input()) for _ in range(2)]
x = 1
for _ in range(n):
    if x < k:
        x *= 2
    else:
        x += k
print(x)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
for i in range(n):
    if ans*2 > ans + k:
        ans += k
    else:
        ans *= 2
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    if ans >= K:
        ans += K
    else:
        ans += ans
print(ans)

Solution (Python):
import sys
a = []
x = 1
for line in sys.stdin:
    a.append(int(line))
for hoge in range(a[0]):
    x += x if x < a[1] else a[1]
print(x)

Solution (Python):
n=int(input());k=int(input());r=1
for _ in[0]*n:r+=min(r,k)
print(r)

Solution (Python):
n=int(input());k=int(input());r=1
for _ in[0]*n:r+=min(r,k)
print(r)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
for i in range(n):
    ans = min(ans*2, ans+k)

print(ans)

Solution (Python):
n=int(input())
k=int(input())
s=1
for i in range(n):
    if s>k:
        s+=k
    else:
        s*=2
print(s)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
for i in range(n):
    ans = min(ans * 2, ans + k)
    
print(ans)

Solution (Python):
n = int(input())
k = int(input())
num = 1

for i in range(n):
    if num <= k:
        num *= 2
    else:
        num += k

print(num)

Solution (Python):
N = int(input())
K = int(input())

n = 1

for i in range(N):
    if 2 * n < n + K:
        n *= 2
    else:
        n += K
print(n)

Solution (Python):

n = int(input())
k = int(input())
ans = 1
for i in range(n):
    if ans<k:
        ans*=2
    else:
        ans+=k
print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for s in range(n):
  if ans*2<ans+k:
    ans*=2
  else:ans+=k
print(ans)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
  ans = min(ans*2, ans+K)
print(ans)

Solution (Python):
n=int(input());k=int(input())
i=1
for j in range(n):
    i=min(2*i,i+k)
print(i)

Solution (Python):
n,k=int(input()),int(input())
ans=1
for _ in range(n):
  if ans<=k:
    ans*=2
  else:
    ans+=k
print(ans)

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s


n = ip()                              









k = ip()



s =1
for i in range(n):
    s = min(s*2,s+k)
print(s)

Solution (Python):
N,K = int(input()),int(input())
A = 1
for i in range(N):
    J1 = A * 2
    J2 = A + K
    if J1 < J2:
        A = J1
    else:
        A = J2
print(A)

Solution (Python):
N = int(input())
K = int(input())

ans = 1

for i in range(N):
    if 2 * ans < ans + K:
        ans *= 2
    else:
        ans += K

print(ans)

Solution (Python):
n = int(input())
k = int(input())
a = 1
for i in range(n):
  if a < k:
    a = a*2
  else:
    a += k
print(a)

Solution (Python):
N = int(input())
K = int(input())
ans = 10000
for i in range(N+1):
    ans = min(1*2**i + K*(N-i), ans)
print(ans)

Solution (Python):
N=int(input())
K=int(input())
sum=1
for i in range(N):
    if sum+K<=2*sum:
        sum+=K
    else:
        sum*=2
print(sum)

Solution (Python):
n = int(input())
k = int(input())
s = 1
for i in range(n):
    s = min(s*2, s+k)
print(s)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    if ans<=k:
        ans*=2
    else:
        ans+=k
print(ans)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
for i in range(n):
    ans = min(ans * 2, ans + k)
    
print(ans)

Solution (Python):
keizi = 1
N = int(input())
K = int(input())

for _ in range(N):
    Adis = keizi
    Bdis = K
    if Adis < Bdis:
        keizi *= 2
    else:
        keizi += K

print(keizi)

Solution (Python):
a = int(input())
b = int(input())
ans = 1
for i in range(a):
  ans = min(ans * 2,ans + b)
print(ans)

Solution (Python):
def foo(N, K):
    x = 1
    for i in range(N):
        x = min([x*2, x+K])
    return x

print(foo(int(input()), int(input())))

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
  if(ans*2 < ans+K):
    ans *= 2
  else:
    ans += K
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 0
num = 1
for i in range(N):
  if(num*2 < num+K):
    num *= 2
  else:
    num += K
  ans = max(ans, num)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1

for i in range(n):
  if ans <=k:
    ans = ans * 2
  else:
    ans = ans + k
print(ans)

Solution (Python):
int_n = int(input())
int_k = int(input())

counter = 1

for i in range(int_n):
    if (counter * 2) <= (counter + int_k):
        counter = counter * 2
    else:
        counter = counter + int_k

print(counter)

Solution (Python):
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if a*2 < a+k:
        a *= 2
    else:
        a += k
print(a)

Solution (Python):
N=int(input())
K=int(input())
ans=1
for _ in range(N):
  if ans<K:
    ans*=2
  else:
    ans+=K
print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
  ans=min(ans*2,ans+k)
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for _ in range(N):
  if ans + K > ans * 2:
    ans *= 2
  else:
    ans += K
print(ans)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
    ans = ans*2 if ans < k else ans+k
print(ans)

Solution (Python):
N = int(input())
K = int(input())
M = 1
for i in range(N):
    if M*2 > M + K:
        M = M + K
    else:
        M = M*2
print(M)

Solution (Python):
N = int(input())
K = int(input())

s = 1
for i in range(N):
    if s > K:
        s += K
    else:
        s *= 2

print(s)

Solution (Python):
N=int(input())
K=int(input())

count=1
for _ in range(N):
    count=min(count+K,count*2)
print(count)

Solution (Python):
a=int(input())
b=int(input())
c=1
for i in range(a):
	if c<b:
		c=c*2
	else:
		c=c+b
print(c)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  if ans*2<=ans+k:
    ans*=2
  else:
    ans+=k
print(ans)

Solution (Python):
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if a*2 < a+k:
        a *= 2
    else:
        a += k
print(a)

Solution (Python):
N = int(input())
K = int(input())

total = 1
for i in range(N):
    if total * 2 > total + K:
        total += K
    else:
        total *= 2
print(total)

Solution (Python):
def func(x, k):
    return min([2 * x, x + k])


def main():
    n = int(input())
    k = int(input())

    now = 1
    for _ in range(n):
        now = func(now, k)
    print(now)


if __name__ == '__main__':
    main()

Solution (Python):

def getInt(): return int(input())
def zeros(n): return [0]*n
def genBit(n): 
    blist = zeros(n)
    for i in range(2**n):
        for k in range(n):
            blist[k] = i%2
            i //= 2
        yield blist
def db(x): 
    global debug
    if debug: print(x)
debug = False

N = getInt()
K = getInt()
minD = 0
for b in genBit(N):
    d = 1
    for i in range(N):
        if b[i]==0: d*=2
        if b[i]==1: d+=K
    if minD==0: minD = d
    elif d<minD: minD = d
    db(minD)
print(minD)

Solution (Python):
n = int(input())
k = int(input())

bord = 1
for i in range(n):
    bord = min(bord*2, bord + k)
    
print(bord)

Solution (Python):
n = int(input())
k = int(input())
s = 1

for _ in range(n):
    s = min(s * 2, s + k)
    
print(s)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
count = 0
while n > count and ans <= k:
    ans *= 2
    count += 1
    
print((n - count) * k + ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    if ans <= K:
        ans *= 2
    else:
        ans += K
print(ans)

Solution (Python):
N = int(input())
K = int(input())
ans = 1
for i in range(N):
    ans += K if ans+K <= ans*2 else ans
print(ans)

Solution (Python):
N=int(input())
K=int(input())
res=1
for i in range(N):
  if res <= K:
    res*=2
  else:
    res+=K
print(res)

Solution (Python):
n = int(input())
k = int(input())
ans = 1

for _ in range(n):
    ans = min(ans+k,2*ans)

print(ans)

Solution (Python):
n=int(input())
k=int(input())

mydata=1
for i in range(n):
  mydata=min(2*mydata,mydata+k)
  
print(mydata)

Solution (Python):
a=int(input())
b=int(input())
p=len(format(b,"b"))
print(2**min(a,p)+b*(max(a-p,0)))

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
  if (ans <= k):
    ans *= 2
  else:
    ans += k
print(ans)

Solution (Python):
n=int(input())
k=int(input())
a=1
for i in range(n):
	if a>=k:
		a+=k
	else:
		a*=2
print(a)

Solution (Python):
n= int(input())
k= int(input())
ans =1
for i in range(n):
  if ans*2 <= ans+k:
   ans = ans*2
  else:
   ans += k
print(ans)

Solution (Python):
N = int(input())
K = int(input())
x = 1
for _ in range(N):
    if x <= K:
        x *= 2
    else:
        x += K
print(x)

Solution (Python):
n=int(input())
k=int(input())
s=1
for i in range(n):s=min(s*2,s+k)
print(s)

Solution (Python):
N = int(input())
K = int(input())
i = 1
j = 1

if N == 1:
    print(2)
else:
    while j < K:
       i = i+1
       j = j*2

    for k in range(N-i+1):
        j  += K

    print(j)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for _ in range(n):
    if ans < k:
        ans *= 2
    else:
        ans += k
print(ans)

Solution (Python):
n=int(input())
k=int(input())
s=1
for i in range(n):
  if (s*2)-s<=k:
    s=s*2
  else:
    s+=k
print(s)

Solution (Python):
N = int(input())
K = int(input())

current = 1
for i in range(N) :
	if (current < K) :
		current = current * 2
	else :
		current = current + K

print(current)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    if ans+k>ans*2:
        ans=ans*2
    else:
        ans=ans+k
print(ans)

Solution (Python):
n, k = [int(input()) for _ in range(2)]
ans = 1
while ans < k and n:
    ans *= 2
    n -= 1
while n:
    ans += k
    n-= 1
print(ans)

Solution (Python):
N = int(input())
K = int(input())
num = 1
for i in range(N):
    if num <= K:
        num *= 2
    else:
        num += K

print(num)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
    if(ans*2<ans+K):
        ans = ans*2
    else:
        ans = ans + K
print(ans)

Solution (Python):
n=int(input())
k=int(input())
ans=1
for i in range(n):
    ans=min(ans*2,ans+k)
print(ans)

Solution (Python):
n = int(input())
k = int(input())
s = 1
for i in range(n):
    if s < k:
        s *=2
    else: s += k
print(s)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
  if(ans*2 > ans+K):
    ans += K
  else:
    ans *= 2
print(ans)

Solution (Python):
n = int(input())
k = int(input())
rs = 1
for i in range(n):
    if rs*2>rs + k:
        rs += k
    else:
        rs *= 2
print(rs)

Solution (Python):
def abc076_b():
    n = int(input())
    k = int(input())
    ans = 1
    for _ in range(n):
        ans = min(ans * 2, ans + k)
    print(ans)


abc076_b()

Solution (Python):
n = int(input())
k = int(input())

x = 1

for i in range(n):
    if 2*x >= (x+k):
        x = x+k
    else:
        x = 2*x
print(x)

Solution (Python):
N = int(input())
K = int(input())

ans = 1
for i in range(N):
    if ans < K:
        ans *= 2
    else:
        ans += K

print(ans)

Solution (Python):
n = int(input())
k = int(input())

ans = 1
ncount = 0
for i in range(n):
  ans *= 2
  ncount += 1
  if ans > k:
    break

nrest = n - ncount
for j in range(nrest):
  ans += k
  
print(ans)

Solution (Python):



def main():
    """Function."""
    n = int(input())
    k = int(input())

    flag = 0
    temp = 1
    for _ in range(n):
        if flag == 0:
            if temp < k:
                temp = temp * 2
            else:
                temp += k
                flag = 1

        elif flag == 1:
            temp += k
    print(temp)


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = int(input())
    k = int(input())
    res = 1
    for _ in range(n):
        res = min(res * 2, res + k)
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
k = int(input())
count = 1
for _ in range(n):
    count = min(count * 2, count + k)
print(count)

Solution (Python):
N = int(input())
K = int(input())
r = 1
for i in range(N):
    A = r*2
    B = r+K
    r=min(A,B)
print(r)

Solution (Python):

N, K = int(input()), int(input())
val = 1
for _ in range(N):
    if val * 2 >= val + K:
        val += K
    else:
        val *= 2
print(val)

Solution (Python):
N=int(input())
K=int(input())
A=0
B=0
kekka=1
Min=1

for i in range(N):
    bai=Min*2
    if(Min+K>bai):
        Min=bai
    else:
        Min+=K

print(Min)

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    ans = min(ans*2, ans+k)
print(ans)

Solution (Python):
n=int(input())
k=int(input())
num=1
for i in range(n):
  num = min(2*num,num+k)
print(num)

Solution (Python):
N = input()
K = input()
res = 1
for i in range(N):
    res = min(res * 2, res + K)
print res

Solution (Python):
n = int(input())
k = int(input())
ans = 1
for i in range(n):
    if ans < k:
        ans *= 2
    else:
        ans += k

print(ans)