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