main = print . solve . map read . words =<< getContents

solve :: [Int] -> Int
solve [n,k] = solve' n k 1

solve' 0 _ x = x
solve' n k x
    | x < k = solve' (n-1) k (x*2)
    | otherwise = solve' (n-1) k (x+k)
