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