#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
struct Rect
{
int x1, y1, x2, y2;
};
int area(Rect rect)
{
int ans = ((rect.x2 - rect.x1) * (rect.y2 - rect.y1));
return ans;
}
int inter(Rect b, Rect t)
{
Rect in;
int ar;
in.y1 = (t.y1 <= b.y1) ? b.y1 : t.y1;
if (t.y2 >= b.y1 && t.y2 >= b.y2)
{
in.y2 = b.y2;
}
else if (t.y2 >= b.y1 && t.y2 <= b.y2)
{
in.y2 = t.y2;
}
if (t.x1 >= b.x1 && t.x1 <= b.x2)
{
in.x1 = t.x1;
}
else if (t.x1 <= b.x1 && t.x1 <= b.x2)
{
in.x1 = b.x1;
}
in.x2 = (t.x2 >= b.x2) ? b.x2 : t.x2;
ar = area(in);
return ar;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int ans;
Rect b1, b2, t;
cin >> b1.x1 >> b1.y1 >> b1.x2 >> b1.y2;
cin >> b2.x1 >> b2.y1 >> b2.x2 >> b2.y2;
cin >> t.x1 >> t.y1 >> t.x2 >> t.y2;
int ib1 = inter(b1, t);
int ib2 = inter(b2, t);
ans = area(b1) + area(b2) - ib1 - ib2;
cout << ans;
return 0;
}