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