/* ---------- STL Libraries ---------- */ // IO library #include #include #include #include #include // algorithm library #include #include #include #include #include // container library #include #include #include #include #include #include #include #include #include #include #include /* ---------- Namespace ---------- */ using namespace std; /* ---------- Type ---------- */ using ll = long long; #define int ll #define P pair /* ---------- Constants */ const double PI = 3.141592653589793238462643383279; const ll MOD = 1e9 + 7; const int INF = 1LL << 55; /* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */ signed main() { int A, B, C, D; cin >> A >> B >> C >> D; int ret = 0; for (int i = A; i <= B; i++) { for (int j = C; j <= D; j++) { if (i != j) ret++; } } cout << ret << endl; return 0; }