m0_66161447:
#include
using namespace std;
typedef long long ll;
int main()
{
ll x1,y1,x2,y2,x3,y3,x4,y4;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
ll res = (x1 - x2) * (y1 - y2) + (x3 - x4) * (y3 - y4);
//计算重合面积的长和宽
ll c = min(x2,x4) - max(x1,x3);
ll k = min(y2,y4) - max(y1,y3);
if(c > 0 && k > 0)
res -= c * k;
cout< return 0; }