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