from math import ceil

def solve(a, b):
    x = ceil(abs(a - b)/2)
    y = abs(a - b)//2
    if x != y:
        return ((1+y)*y)//2 + ((x+1)*x)//2
    else:
        return ((1+y)*y)


def main():
    a = int(input())
    b = int(input())
    print(solve(a, b))


main()
