function Main(input) {
	var input = input.trim().split(" ");
	var a = Number(input[0]);
	var b = Number(input[1]);
	var arg = b - a;
	var sum = 0;
	for(var i = 0;i<=arg;i++){
		sum += i;
	}
	console.log(sum - b);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));