const fs = require("fs");

function Main(input){
    input = input.split(" ");
    const a = parseInt(input[0]);
    const b = parseInt(input[1]);
    const N = b - a;
    var x = N*(N-1)/2 - a;
    console.log(x);
}

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