import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);int n = in.nextInt(); int a = in.nextInt(); int b = in.nextInt(); long sum = 0; for (int i = 0; i < n; i++) {int x1 = in.nextInt(); int y1 = in.nextInt(); int x2 = in.nextInt(); int y2 = in.nextInt(); if (x1 >= 0 && y1 >= 0 && x2 <= a && y2 <= b) {sum += (long) (y2 - y1) * (x2 - x1); } else if (x1 < 0 && x2 > 0 && y1 < 0 && y2 > 0) {sum += (long) y2 * x2; } else if (x1 >= 0 && x2 <= a && y1 < 0 && y2 > 0) {sum += (long) y2 * (x2 - x1); } else if (x1 < a && x2 > a && y1 < 0 && y2 > 0) {sum += (long) (a - x1) * y2; } else if (x1 < a && x2 > a && y1 >= 0 && y2 <= b) {sum += (long) (y2 - y1) * (a - x1); } else if (x1 < a && x2 > a && y1 < b && y2 > b) {sum += (long) (b - y1) * (a - x1); } else if (x1 >= 0 && x2 <= a && y1 < b && y2 > b) {sum += (long) (b - y1) * (x2 - x1); } else if (x1 < 0 && x2 > 0 && y1 < b && y2 > b) {sum += (long) x2 * (b - y1); } else if (x1 < 0 && x2 > 0 && y1 >= 0 && y2 <= b) {sum += (long) x2 * (y2 - y1); }}System.out.print(sum); }
}