"use strict"
function Main(input) {
    if (!input.match(/([\n])/)){
        input = input.split(" ");
    } else {
        input = input.split("\n");
        for (var i = 0; i < input.length; i++){
            input[i] = input[i].split(" ");
        }
    }
    //中身↓
    let count = 0;
    let check = 0;
    
    for(var i = 1; i <= 999; i++){
        count += i;
        if(count >= input[0] && count <= input[1]){
            check = count;
        }
    }
    //console.log(count);
    //console.log(check[0]+","+check[1]);
    console.log(check-input[0]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));