#include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int t = (b - a + 1) * (d - c + 1); if (c < b) { t -= b - c + 1; } cout << t << endl; return 0; }