
def main():
    a = int(input())
    b = int(input())
    if (b-a)%2==0:
        d = abs((b-a))//2
        r = d*(d+1)
    else:
        d = abs((b - a)) // 2
        r = d * (d + 1)//2
        r+=  (d+1) * (d + 2)//2
    print(r)



if __name__ == "__main__":
    main()
