{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}

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

solve :: Int -> Int -> Int
solve n k = foldr operate 1 [1 .. n] where
  operate _ x = min (x * 2) (x + k)
