using namespace std;
#define x first
#define y second
typedef pair<int, int> PII;
const int N = 1e6 + 10;
PII x ={1000, -1000} , y = {-1000, 1000}, xx = {1000, -1000}, yy = {-1000,1000};
int main()
{
PII a[2], b[2],c[2];
cin >> a[0].x >>a[0].y >>a[1].x >>a[1].y;
cin >> b[0].x >>b[0].y >>b[1].x >>b[1].y;
if(a[0].x>=b[0].x&&a[1].x<=b[1].x&&a[0].y>=b[0].y&&a[1].y<=b[1].y){
cout << 0 << endl;
return 0;
}
bool t1 = false, t2 = false, t3 = false, t4 = false;
int cnt = 0;
for(int i = a[0].x; i <= a[1].x; i ++)
{
for(int j = a[0].y; j <= a[1].y; j ++)
{
if(i >= b[0].x && i <= b[1].x && j >= b[0].y && j <= b[1].y)
{
if(i == a[0].x && j == a[0].y)cnt ++;
if(i == a[1].x && j == a[0].y)cnt ++;
if(i == a[0].x && j == a[1].y)cnt ++;
if(i == a[1].x && j == a[1].y)cnt ++;
if(i <= x.x && j >=x.y)
{
x = {i, j};
}
if(i >= y.x&&j <= y .y)
{
y = {i,j};
}
}
}
}
int ans = (abs(a[0].x - a[1].x)) * (abs(a[1].y - a[0].y));
if(cnt >= 2) ans -= (abs(y.x - x.x)) * (abs(y.y - x.y));
cout << ans << endl;
}