#include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int cnt = 0; for (int i = a; i <= b; i++) { for (int j = c; j <= d; j++) { if (i == j) { cnt++; } } } int s = (b - a + 1) * (d - c + 1); cout << s - cnt << endl; }