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