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