#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 1000000000 #define MOD 1000000007 typedef long long ll; typedef unsigned long long ull; using namespace std; #define int long long struct Setup { Setup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } SETUP; signed main() { int a, b, c, d; cin >> a >> b >> c >> d; int ans = 0; for (int i = a; i <= b; i++) { for (int j = c; j <= d; j++) { if (i != j) { ans++; } } } cout << ans << endl; }