#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using lli = long long int; template void init_n(vector& v, size_t n, U x) { v = vector(n, x); } template void init_n(vector& v, size_t n) { init_n(v, n, T()); } template void read_n(vector& v, size_t n, size_t o = 0) { v = vector(n+o); for (lli i=o; i> v[i]; } template void read_n(T a[], size_t n, size_t o = 0) { for (lli i=o; i> a[i]; } template T gabs(const T& x) { return max(x, -x); } #define abs gabs lli a, b, c, d; int main() { cin >> a >> b >> c >> d; lli ans = 0; for (lli i = a; i <= b; ++i) { for (lli j = c; j <= d; ++j) { if (i != j) ++ans; } } cout << ans << '\n'; return 0; }