#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; void solve() { int a, b, c, d; cin >> a >> b >> c >> d; set s; rep(i, a, b + 1) s.emplace(i); rep(i, c, d + 1) s.emplace(i); int x = b + 1 - a; int y = d + 1 - c; cout << (x * y - (x + y - s.size())) << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); getchar(); }