function Main(input){

input=input.split(" ");
inA=parseInt(input[0]);
inB=parseInt(input[1]);

answer = 0;

C = inB - inA;
D = 0;

for (i = 1; i < C; i++) {
    D = D + i;
}

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