#include using namespace std; typedef long long ll; int main() { int ans = 0; int a, b, c, d; 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 << endl; return 0; }