def area(a,b): return (a**3-b**3)/3-(a+b)/2*(a**2-b**2)+a*b*(a-b) a,b=map(int,input().split()) print(area(a,b))