#include #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if(!(p)) #define until(p) while(!(p)) using ll = std::int64_t; using P = std::tuple; int A, B, C, D; int main(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cin >> A >> B >> C >> D; int cnt = 0; for(int i=A;i<=B;++i){ for(int j=C;j<=D;++j){ if(i != j){ cnt += 1; } } } std::cout << cnt << std::endl; }