import qualified Data.IntSet as S

main = do
  n <- readLn
  k <- readLn
  print $ S.findMin $ solve n k

solve 0 _ = S.singleton 1
solve n k = S.map (* 2) s `S.union` S.map (+ k) s
  where s = solve (n - 1) k