a=int(input())
b=int(input())
ust=0
if(a>b):
    s=a-b
else:
    s=b-a
if(s>1):
    if(s%2==0):
        shagi=s//2
        for i in range(1, shagi+1):
            ust+=2*i
    else:
        shagi=s//2+1
        for i in range(1, shagi+1):
            ust+=2*i
        ust-=shagi
else:
    ust=1
print(ust)
