a,b,c,d=list(map(int,input().split())) n=(b-a+1)*(d-c+1) s=min(b,d) i=max(a,c) e=s-i+1 print(n-max(0,e))