A,B,C,D = map(int,input().split()) X = (B-A+1) * (D-C+1) Y = min(B, D) - max(A, C) + 1 print(X - max(Y, 0))