import java.util.Scanner;
public class Draw {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[][] arr = new int[101][101];
int num = scanner.nextInt();
for(int i = 0; i < num; i++){
int x1 = scanner.nextInt();
int y1 = scanner.nextInt();
int x2 = scanner.nextInt();
int y2 = scanner.nextInt();
for(int j = x1; j < x2; j++){
for(int k = y1; k < y2; k++){
arr[j][k] = 1;
}
}
}
int sum = 0;
for(int i = 0; i < arr.length; i++){
for(int j = 0; j < arr[0].length; j++){
sum += arr[i][j];
}
}
System.out.println(sum);
}
}