a, b = map(int, input().split()) s = a**3 - 3*a**2*b + 3*a*b**2 - b**3 s = abs(s) s/=6 print(s)