'use strict'

function Main(input) {
  const a = Number(input.split(' ')[0]);
  const b = Number(input.split(' ')[1]);

  const dif = b - a;
  let lowtower = 0;

  for(let i=dif; i>0; i--) {
    lowtower += i;
  }

  console.log(lowtower - b);

}

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