#include <bits/stdc++.h>
using namespace std;
struct node {
  int x1, y1, x2, y2;
} a[105];
int num[105][105];
int n;
int main(void) {
  int i, j, x1, y1, x2, y2;
  while (~scanf("%d", &n)) {
    memset(num, 0, sizeof(num));
    for (i = 1; i <= n; i++) {
      scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
      a[i].x1 = x1;
      a[i].x2 = x2;
      a[i].y1 = y1;
      a[i].y2 = y2;
    }
    int x, y;
    for (x = 1; x <= 100; x++) {
      for (y = 1; y <= 100; y++) {
        for (i = 1; i <= n; i++) {
          if (a[i].x1 <= x && a[i].y1 <= y && a[i].x2 >= x && a[i].y2 >= y)
            num[x][y]++;
        }
      }
    }
    int ans = 0;
    for (x = 1; x <= 100; x++)
      for (y = 1; y <= 100; y++) ans += num[x][y];
    printf("%d\n", ans);
  }
  return 0;
}
