function main(input) {
    var a = input[0].split(" ")[0]-0;
    var b = input[0].split(" ")[1]-0;
    var max = 1000*999/2;
    var ans = 0;
    var tmp = 0;
    for(var i=1;i<max;i++){
        tmp += i;
        if(tmp>a && tmp-a == (tmp+i+1)-b){
            ans = tmp-a;
            break;
        }
    }
    console.log(ans);
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
