#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i ) #define rep(i,n) REP(i,0,n) typedef long long ll; typedef pair pint; typedef pair pli; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; int ans=0; if(a>c){ int temp=a; a=c; c=temp; int temp2=b; b=d; d=temp2; } if(b<=c){ ans=(b-a+1)*(d-c+1); }else{ ans=(b-a+1)*(d-c+1); ans-=(b-c+1); } cout << ans << endl; return 0;}