a=int(input())
b=int(input())
if b>a:
    d=b-a
    if d%2==0:
        n=d/2
        print(n*(n+1))
    else:
        n=d//2
        t=d-n
        s=(n*(n+1))/2
        q=(t*(t+1))/2
        print(s+q)
else:
    d=a-b
    if d%2==0:
        n=d/2
        print((n*(n+1))/2)
    else:
        n=d//2
        t=d-n
        s=(n*(n+1))/2
        q=(t*(t+1))/2
        print(s+q)
    
