solve :: Int -> Int -> Int -> Int
solve 0 _ r = r
solve n k r = solve (n - 1) k next
  where next = if r < k then r * 2 else r + k

main :: IO ()
main = do
  n <- readLn
  k <- readLn
  print $ solve n k 1