# import sys
# sys.stdin=open("input.in","r")
a=int(input())
b=int(input())
print(((abs(a-b)+1)**2)//4)


# c=(a+b)//2
# d=abs(a-c)
# e=abs(b-c)
# d=(d*(d+1))//2
# e=(e*(e+1))//2
# print(int(d)+int(e))