#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i, n) for(ll i = 0;i < n;i++) #define REPR(i, n) for(ll i = n;i >= 0;i--) #define FOR(i, m, n) for(ll i = m;i < n;i++) #define FORR(i, m, n) for(ll i = m;i >= n;i--) #define REPO(i, n) for(ll i = 1;i <= n;i++) #define ll long long #define INF 1999999999 #define MINF -1999999999 #define INF64 1999999999999999999 #define ALL(n) n.begin(),n.end() #define MOD 1000000007 int main() { ll a, b, c, d, ans = 0; cin >> a >> b >> c >> d; FOR(i, a, b + 1) { FOR(j, c, d + 1) { if (i != j)ans++; } } cout << ans << endl; }