def f(x): global a global b return (1/6)*x*((6*a*b)-(3*a*x)-(3*b*x)+(2*x*x)) a,b=map(float,input().split()) print(abs(f(a)-f(b)))