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