from math import *
n = int(input())
m = int(input())
diff = abs(m-n)
count = 0
i = 0
diff1 = diff//2
for i in range(1,diff1+1):
    count = count + 2*i
if diff%2 != 0:
    count = count + i+1
print(count)