a = int(raw_input())
b = int(raw_input())

diff = abs(a - b)

if diff % 2 == 0:
    print (diff / 2) * (diff / 2 + 1)
    exit()

if diff % 2 == 1:
    print 1 + diff / 2 + (diff / 2) * (diff / 2 + 1)
    exit()
