/* No.799 赤黒かーどげぇむ https://yukicoder.me/problems/no/799 */ #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; int S = (b - a + 1) * (d - c + 1); if (b >= c) S -= (b - c + 1); cout << S << endl; }