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