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