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