#include using namespace std; int main(){ int A,B,C,D; cin >> A >> B >> C >> D; int ans = (D-C+1)*(B-A+1) -max({min({B-C,D-A})+1,0}); cout << ans << endl; }