import java.util.*;
public class Main{
static long x1,y1,x2,y2,x3,y3,x4,y4;
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
x1 = sc.nextLong();
y1 = sc.nextLong();
x2 = sc.nextLong();
y2 = sc.nextLong();
x3 = sc.nextLong();
y3 = sc.nextLong();
x4 = sc.nextLong();
y4 = sc.nextLong();
long sum = (x2 - x1) * (y2 - y1) + (x4 -x3) * (y4 - y3);
long sum2 = 0;
if(x3 < x2 && y3 < y2 && x1 < x4 && y1 < y4){
long x11 = Math.max(x1, x3);
long y11 = Math.max(y1, y3);
long x22 = Math.min(x2, x4);
long y22 = Math.min(y2, y4);
sum2 = (x22 - x11) * (y22 - y11);
}
System.out.println(sum - sum2);
}
}