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