function Main(input){
    var arr = [];
    arr = input.split(' ');
    var a = parseInt(arr[0]);
    var b = parseInt(arr[1]);
    var diff = b - a;
    var result = 1;

    for(diff = 0; diff <= 999; diff++){
        result =+ diff;
    }
    console.log(result - b);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));