"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
　 let a = 0;
   let b = 0;
   
   for(let i=1; i<xs[0]; i++){
      if(a<xs[0]){
      a += i;
      }else{
      break;
      }
   }
   for(let i=1; i<xs[1]; i++){
      if(b<xs[1]){
      b += i;
      }else{
      break;
      }
   }
   let ans = a+b;
   let ans1 = xs[0]+xs[1]
   console.log((ans-ans1)/2);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));