const main = stdin => {
  const input = stdin.trim().split('\n')
  const [a, b] = input[0].split(' ').map(x => parseInt(x))

  const diff = b - a
  let sum = 0
  for (let i = 1; i <= 499500; i++) {
    sum += i
    if (sum - i === sum - diff) {
      break
    }
  }

  const snow = sum - b
  console.log(snow)
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
