main :: IO ()
main = do
  n <- readLn :: IO Int
  k <- readLn :: IO Int
  print $ solver n k

solver :: Int -> Int -> Int
solver n k = greedy n 1
  where
    greedy 0 x = x
    greedy i x = if a < b then greedy (i - 1) a else greedy (i - 1) b
      where
        a = x * 2
        b = x + k