function Main(s){
	s=s.split(/\s/);
	s.forEach(function(e,i,a){a[i]=Number(a[i]);});
	var a=s[1]-s[0];
	var b=0;
	for(var i=0;i<a;i=(i+1)|0){b+=i;}
	console.log(b-s[0]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));