#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main() {
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a > c) {
		swap(a, c);
		swap(b, d);
	}
	else if (a == c && b > d) {
		swap(b, d);
	}
	if (b < c)cout << (b - a + 1)*(d - c + 1) << endl;
	else if (a<c&&b>d)cout << (b - a + 1)*(d - c + 1) - (d - c + 1) << endl;
	else cout << (b - a + 1)*(d - c + 1) - (b - c + 1) << endl;
	getchar(); getchar(); return 0;
}