A,B,C,D = [int(i) for i in input().split()] dup = min([B-C+1,D-A+1]) print( (B-A+1)*(D-C+1)-dup if dup>0 else (B-A+1)*(D-C+1) )