/* 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 = 0; for (int i = a; i <= b; i++) { for (int j = c; j <= d; j++) { if (i != j) s++; } } cout << s << endl; }