#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; cout << (b - a + 1) * (d - c + 1) - max(0, min(b, d) - max(a, c) + 1) << endl; return 0; }