module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector.Unboxed           as V
import           Text.Printf

main :: IO ()
main = do
  [a,b] <- map read . words <$> getLine :: IO [Int]
  print . flip (-) b $ sum [1..(b - a)]

