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