```
public class Solution {
public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
int areaA = (D - B) * (C - A);
int areaB = (H - F) * (G - E);
int lowerTop = Math.min(D, H);
int upperBot = Math.max(B, F);
int lefterRight = Math.min(C, G);
int righterLeft = Math.max(A, E);
int overlap = 0;
if (lowerTop > upperBot && lefterRight > righterLeft) {
overlap = (lowerTop - upperBot) * (lefterRight - righterLeft);
}
return areaA + areaB - overlap;
}
}
```