#print('Hare Krishna')
def I():
    return int(input())
def IL():
    return [int(i) for i in input().split()]
def IM():
    return map(int,input().split())
def IS():
    return input()
a=I()
b=I()
a,b=min(a,b),max(a,b)
diff=b-a 
a=diff//2 
b=diff//2+diff%2 
print(a*(a+1)//2+b*(b+1)//2)