#include #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(obj) obj.begin(), obj.end() const int iINF = 1e9; const long long llINF = 1e18; const int MOD = 1e9 + 7; using namespace std; int main() { int A, B, C, D, ans = 0; cin >> A >> B >> C >> D; for(int x = A; x < B + 1; x++) { for(int y = C; y < D + 1; y++) { if(x == y) continue; ans += 1; } } cout << ans << endl; }