open System


[<EntryPoint>]
let main argv =
    let a,b=stdin.ReadLine().Split()|>fun c -> int c.[0],int c.[1]
    let d=b-a
    [1..d-1]
    |>List.sum
    |>fun s -> s-a
    |>stdout.WriteLine
    0