a, b, c, d = map(int, input().split()) cross = max(b-(c-1), 0) ans = (b-(a-1))*(d-(c-1))-cross print(ans)