  function main(input) {
  	var tmp = input.split(' ');
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);

    var n = b - a - 1;
    var answer = n*(n+1)/2 - a;

    console.log(answer);

  }
  main(require('fs').readFileSync('/dev/stdin', 'utf8'));
