a = int(input())
b = int(input())

n = abs(b-a)
e = 0
c = 0
if n%2 != 0:
    nt = int((n/2) + 0.5)
else:
    nt = int(n/2)
  
for i in range(nt+1):
     e = e + 2*i
     
if n%2 !=0:
    c = e - nt
else:
    
    c = e
    
print(c) 