a, b = int(input()), int(input())
len = abs(abs(a) - abs(b))

if len == 1:
    res = len
else:
    len1 = len // 2
    len2 = len - len1
    res = (1 + len1) / 2 * len1 + (1 + len2) / 2 * len2

print(int(res), end='')


