#include <bits/stdc++.h>
using namespace std;
const int dr[] = {0, -1, 0, 1, -1, 1, 1, -1};
const int dc[] = {1, 0, -1, 0, 1, 1, -1, -1};
unsigned int inp() {
  unsigned int n;
  int c;
  while ((c = getchar()) < '0') {
    ;
  }
  n = c - '0';
  while ((c = getchar()) >= '0') n = n * 10 + (c - '0');
  return n;
}
void pt(unsigned int n) {
  unsigned char stack[30];
  int top = 0;
  if (n == 0) {
    putchar('0');
  } else {
    while (n > 0) {
      stack[top++] = n % 10 + '0';
      n /= 10;
    }
    while (top > 0) {
      putchar(stack[--top]);
    }
  }
  putchar('\n');
}
int a[1000005], b[1000005], d[200][200];
char s1[1000005], s2[1000005];
int main() {
  int n, m, i, j, k, t, c = 0, l, x, y, z, p, q;
  long long ans = 0;
  scanf("%d", &n);
  memset(d, 0, sizeof(d));
  while (n--) {
    scanf("%d %d", &x, &y);
    scanf("%d %d", &p, &q);
    for (int i = x; i < p + 1; i++) {
      for (int j = y; j < q + 1; j++) d[i][j]++;
    }
  }
  for (int i = 0; i < 150; i++) {
    for (int j = 0; j < 150; j++) {
      ans += d[i][j];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
