A, B, C, D = map(int,input().split()) All = (B-A+1)*(D-C+1) Red = set([]) Black = set([]) Product = [] for i in range(A, B+1): Red.add(i) for j in range(C, D+1): Black.add(j) Product = Red&Black print(All - len(Product))