(function () {
    var n = parseInt(readline()), s = parseInt(readline());
    var ans = 1;
    n = Math.abs(n - s);
    if (n > 1)
        ans = (n / 2 )|0 * (1 + (n / 2)|0) + n % 2 * ((n / 2)|0 + 1);
    print(ans);
}());
