```
public class Solution {
public int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
int sumA = (C-A) * (D - B);
int sumB = (G - E) * (H - F);
int overLap = 0;
if(E < C && G > A && F < D && H> B){
int leftBottomX = Math.max(A,E);
int leftBottomY = Math.max(B,F);
int rightTopX = Math.min(C,G);
int rightTopY = Math.min(D,H);
overLap = (rightTopX - leftBottomX) * (rightTopY - leftBottomY);
}
return sumA + sumB - overLap;
}
}
```