#include int main(){ int A,B,C,D,i,j,count=0; scanf("%d %d %d %d",&A,&B,&C,&D); for(i=A;i<=B;i++){ for(j=C;j<=D;j++){ if(i==j){ count++; break; } } } printf("%d",(B-A+1)*(D-C+1)-count); }