#include #include #include int main(void){ int a,b,c,d; int yes=0; scanf("%d %d %d %d",&a,&b,&c,&d); for(int i=a;i<=b;i++){ for(int j=c;j<=d;j++){ if(i==j){continue;} else{yes++;} } } printf("%d\n",yes); }