import Data.List

main :: IO ()
main = do
    [n, m] <- map read . words <$> getLine :: IO [Int]
    let ns = drop 1 $ scanl (+) 0 [1..999]
    let towers_diff = map (\(a,b,c)->(c, a-b)) $ zip3 (drop 1 ns) ns [0..]
    let [(i,_)] = filter (\(i, d)->d == m-n) towers_diff
    print $ (ns !! i) - n