A, B, C, D = map(int, input().split()) ab = ((B + 1) - A) cd = ((D + 1) - C) ans = ab*cd if B - C >= 0: ans -= (B - C + 1) print(ans)