function Main(str) {
    str=str.split(/\n/);
    var a = str[0].split(' ')[0];
    var b = str[0].split(' ')[1];
    var total = b-a;
    function cal(a,b,total){
        return total*(total+1)/2-b;
    }
    console.log(cal(a,b,total));
}
 Main(require("fs").readFileSync("/dev/stdin", "utf8"));