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