#include using namespace std; const long long INF = 1LL << 60; #define MOD 1000000007; typedef long long ll; #define writeln(n) cout< P; typedef pair Psi; 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++; } } } writeln(ans); }