'use strict'

function main(input) {

    input = input.split(' ').map(x => +x)
    let b = input[1]
    let d = b - input[0]
    let c = 0
    for (let i = 1; i <= d; i++) {
        c += i
    }
    console.log(c - b)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));