function Main(input) {
    var ab = input.split('\n')[0].split(' ');
    var a = parseInt(ab[0], 10);
    var b = parseInt(ab[1], 10);

    var towers = [];
    
    for (var i = 1, n = 0 ; i <= 999 ; ++i) {
        n += i;
        towers.push(n);
    }

    var t1 = towers[b-a-2];

    console.log(t1 - a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));