#include using namespace std; int main() { int A, B, C, D; cin >> A >> B >> C >> D; int ans = 0; for (int i = A; i <= B; ++i) { for (int j = C; j <= D; ++j) { if (i != j) ++ans; } } cout << ans << endl; return 0; }