module Main where

import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    [a, b] <- fmap read . words <$> getLine :: IO [Int]
    let d = b - a
    let aHeight = sum [1 .. d - 1]
    let ans = aHeight - a
    print ans