#include int count(int,int,int,int); int main(void) { int a,b,c,d; int ans; scanf("%d%d%d%d",&a,&b,&c,&d); ans = count(a,b,c,d); printf("%d\n",ans); return 0; } int count(int a,int b,int c,int d) { int tmp = (b-a+1)*(d-c+1); if(c < b){ if(c < a){ if(d < b){ tmp -= (d-a+1); } else { tmp -= (b-a+1); } } else if(d < b){ tmp -= (d-c+1); } else { tmp -= (b-c+1); } } return tmp; }