function StoneMonument(input) {
    input = input.split("\n");
    tmp = input[0].split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    console.log((b-a)*(b-a+1)/2-b);
}
StoneMonument(require("fs").readFileSync("/dev/stdin", "utf8"));