#include using namespace std; typedef unsigned long long ull; typedef long long ll; int main(){ int a, b, c, d; cin >> a >> b >> c >> d; cout << (b-a+1)*(d-c+1)-max(min(b, d)-max(a, c)+1, 0) << endl; return 0; }