main = do
    [a, b] <- map read . words <$> getLine
    let
        diff = b - a
        right = (towers 999) !! (diff - 1)
        ans = right - b
    putStrLn $ show ans

towers n = scanl (+) 1 [2..n]
