#include #include int main(void){ int a,b,c,d; int xxx; int ans; scanf("%d%d%d%d",&a,&b,&c,&d); ans = (b - a + 1)*(d - c + 1); xxx = ((b - a + 1) + (d - c + 1)) - (abs(a - d) + 1); if(xxx >= 0){ ans -= xxx; } else if(a < c){ ans -= (d - c + 1); } else{ ans -= (b -a + 1); } printf("%d",ans); }