a,b,c,d=map(int,input().split()) print((b-a+1)*(d-c+1)-max(0,b-c+1,d-a+1))