import math
a  = int (input())
b = int (input())
s = math.fabs(b-a )
r = s/2
s = int(s)
r = int(r)

f = 0
e = r+1
w =0
q = 0
if s == 1:
    print("1")
elif s== 2:
    print("2")
elif s==0:
    print("0")
elif s/2 == 0:
    for i in range(r):
        i+=i+1
        
   
    f = i*2
    print(f)
else:
    for i in range(r):
        i+= i+1
    q =i 
    
    for j in range(e):
        j+=j+1
    w = j+1
    print(q+w)    


        
    
