```
public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
int height = (int) Math.max(0, (long) Math.min(D, H) - (long) Math.max(B, F));
int width = (int) Math.max(0, (long) Math.min(C, G) - (long) Math.max(A, E));
int overlap = height * width;
return (D - B) * (C - A) + (H - F) * (G - E) - overlap;
}
```