process.stdin.resume();
process.stdin.setEncoding('utf8');
// Your code here!
var input = '';
process.stdin.on('data', function(chunk) {
    input += chunk;

    var a = input.split(' ')[0];
    var b = input.split(' ')[1];
    var diff = b - a;

    var height = 0
    for(var i = 0; i <= diff; i++){
        height += i;
    }
    
    var snow_height = height - b;
    console.log(snow_height);
});
