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

solve :: Int -> Int -> Int
solve n k = go n [1]
  where
    go 0 xs = minimum xs
    go m xs = go (m-1) $ concat [[2*x,x+k] | x <- xs] 
