#include #include using namespace std; int a, b, c, d; int main() { cin >> a >> b >> c >> d; if (a > c) { swap(a, c); swap(b, d); } int kasanari = max(b - c + 1, 0); cout << (b - a + 1) * (d - c + 1) - kasanari << endl; return 0; }