a,b = map(int, input().split(' ')) ans = (1/3)*(b**3) - (1/2)*(a+b)*(b**2) + a*(b**2) - (1/3)*(a**3) + (1/2)*(a+b)*(a**2) - (a**2)*b print(abs(ans))