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

  var t = b - a
  var tall = 0;
  for (var i = 0; i < t; i++) {
    tall += i + 1
  }
  console.log(tall - b)
}


Main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));
