import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
//键入数值
long x1=sc.nextLong();
long y1=sc.nextLong();
long x2=sc.nextLong();
long y2=sc.nextLong();
long x3=sc.nextLong();
long y3=sc.nextLong();
long x4=sc.nextLong();
long y4=sc.nextLong();
//计算两矩阵面积之和
long s=(x2-x1)*(y2-y1)+(x4-x3)*(y4-y3);
//计算重叠面积
//画图找规律
long a=Math.max(0, Math.min(x2, x4)-Math.max(x1, x3));
long b=Math.max(0, Math.min(y2, y4)-Math.max(y1, y3));
//输出结果
System.out.print(s-a*b);
}
}