import re
import math
import decimal
import bisect

a = int(input())
b = int(input())
dist = abs(a - b)
aDist = dist // 2
bDist = dist - aDist
print((aDist * (aDist + 1) // 2) + (bDist * (bDist + 1) // 2))
