#w, h, w2, h2 =[int(i) for i in input().split()]
a=int(input())
b=int(input())
x=abs(a-b)
if x%2==1:
    n=x//2
    m=x//2+1
    print(n*(n+1)//2+m*(m+1)//2)
else:
    n=x//2
    m=x//2
    print(n*(n+1)//2+m*(m+1)//2)        