var main = function(input) {
input = input.split(' ').map(x=>parseInt(x));
var a = input[0];
var b = input[1];
var N =  b-a;
    var tall = 0;
for(var i=1;i<N;i++){
    tall += i;
    }
    var yuki = tall-a;
    
    console.log(yuki);
    return 0; 
}

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