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