#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int x = 0; int p[101] = {}; for (int i = a; i <= b; i++) { p[i] = 1; } for (int i = c; i <= d; i++) { if (p[i]) x++; } cout << (b - a + 1) * (d - c + 1) - x << endl; return 0; }