```
public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
long area = (C - A) * (D - B) + (G - E) * (H - F);
long minTop = Math.min(D, H), maxBot = Math.max(B, F), maxLeft = Math.max(A, E), minRight = Math.min(C, G);
return (int)(area - Math.max(minTop - maxBot, 0) * Math.max(minRight - maxLeft, 0));
}
```