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