import Control.Applicative
import Control.Monad

main = solve <$> readLn <*> readLn >>= print

solve :: Int -> Int -> Int
solve n k = minimum $ foldl (>=>) return (replicate n (\x -> [ x*2, x+k ])) $ 1