#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; const ll INF = 1e16; const ll MOD = 1e9 + 7; #define REP(i, n) for(ll i = 0; i < n; i++) int main() { ll a, b, c, d; cin >> a >> b >> c >> d; ll ans = 0; for(ll i = a; i <= b; i++){ for(ll j = c; j <= d; j++){ if(i != j) ans++; } } cout << ans << endl; }