#include #include // tree #include // tree /* // 多倍長整数 #include #include using namespace boost::multiprecision; using Bint = cpp_int; */ using namespace std; using namespace __gnu_pbds; // tree #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using ll = long long; using ld = long double; using vi = vector; using vl = vector; using vc = vector; using vs = vector; using vb = vector; using vd = vector; using vld = vector; using vvi = vector>; using vvl = vector>; using vvc = vector>; using vvs = vector>; using vvb = vector>; using vvd = vector>; using vvld = vector>; using vpii = vector>; using vpll = vector>; using vpcc = vector>; using vpss = vector>; using sti = set; using stl = set; using stc = set; using sts = set; using primax_int = priority_queue; using primin_int = priority_queue, greater>; using primax_ll = priority_queue; using primin_ll = priority_queue, greater>; using primax_char = priority_queue; using primin_char = priority_queue, greater>; using primax_string = priority_queue; using primin_string = priority_queue, greater>; using tree_int = tree, rb_tree_tag, tree_order_statistics_node_update>; using tree_ll = tree, rb_tree_tag, tree_order_statistics_node_update>; using tree_char = tree, rb_tree_tag, tree_order_statistics_node_update>; using tree_string = tree, rb_tree_tag, tree_order_statistics_node_update>; #define endl "\n" #define YES printf("YES\n"); #define Yes printf("Yes\n"); #define NO printf("NO\n"); #define No printf("No\n"); #define rep0(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define ALL(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() const int INF = 1e9; const int MININF = -1e9; const ll LINF = 1e18; const ll MINLINF = -1e18; const int MOD = 1e9 + 7; const int MODD = 998244353; const char MARU = 'o'; const char BATU = 'x'; // 8方向(4方向ならN=4で止め。) vi vx = {0, 1, 0, -1, 1, -1, 1, -1}; vi vy = {1, 0, -1, 0, 1, -1, -1, 1}; template bool chmax(T &a, const T& b){ if(a < b){a = b;return true;} return false; } template bool chmin(T &a, const T& b){ if(a > b){a = b;return true;} return false; } // 切り捨て(A/B以下の最大の整数) template T div_floor(T a, T b) { if (b < 0) a = -a, b = -b; return a >= 0 ? a / b : (a + 1) / b - 1; } // 切り上げ(A/B以上の最小の整数) template T div_ceil(T a, T b) { if (b < 0) a = -a, b = -b; return a > 0 ? (a - 1) / b + 1 : a / b; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int A,B,C,D; cin>>A>>B>>C>>D; vi X,Y; for(int i=A;i<=B;i++)X.push_back(i); for(int i=C;i<=D;i++)Y.push_back(i); int ans=0; rep0(i,X.size()){ rep0(j,Y.size()){ if(X[i]!=Y[j])ans++; } } cout<