inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
a = l[0] * 1
b = l[1] * 1 
sum = 1
d = b - a
for (i=2; i<=999; i++) {
    s = sum + i
    if (d == s - sum) {
        ans = sum - a
        break;
    }
    sum = s
}
console.log(ans)