#include using namespace std; signed main () { int a, b, c, d; scanf("%d %d %d %d", &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++; } } } printf("%d\n", ans); return 0; }