#include "bits/stdc++.h" using namespace std; int main() { int A, B, C, D, ans; cin >> A >> B >> C >> D; ans = (B - A + 1) * (D - C + 1); for (int i = 1; i <= 100; i++) { if (A <= i && i <= B && C <= i && i <= D) ans--; } cout << ans; }