a=int(input())
b=int(input())
if a>b:
    k=a-b
    if k%2==0:
        j=k//2
    else:
        j=(k//2)+1
    x=0
    for v in range(j,1,-1):
        x=x+v
    y=0
    for s in range (j-1,1,-1):
        y=y+s
    print(x+y)
else:
    k=b-a
    if k%2==0:
        j=k//2
    else:
        j=(k//2)+1
    x=0
    for v in range(j,1,-1):
        x=x+v
    y=0
    for s in range (j-1,1,-1):
        y=y+s
    print(x+y)
    
    
    
    
        
        
        
