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