#include using namespace std; int main () { int a,b,c,d; cin >> a >> b >> c >> d; if(c<=b&&b=d){ cout <<(b-a+1)*(d-c+1)-(d-c+1); }else{ cout << (b-a+1)*(d-c+1); } }