INF = 999999999999999999L
EPS = 1e-12

def read():
    return raw_input().strip()

def read_ints():
    return map(int,read().split())

a = int(read())
b = int(read())
d = abs(a-b)
if d %2 == 0:
    d /= 2
    print 2 * d*(d+1)/2
else:
    d /= 2
    print 2*d*(d+1)/2 + d+1
