function Main(input) {
  // 入力値（文字列）をスペースで区切り、配列として格納し各要素の値を数値に変換
  const result = input
  .split(/\s/);
  var a = Number(result[0]);
  var b = Number(result[1]);
  var diff = b - a;
  var res =0;
  [...Array(diff).keys()].map(i => ++i).forEach((elm) =>{
    res = res + elm;
  });
  console.log(res- b);
  

};
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
