#include <bits/stdc++.h>
int main(void) {
  int tab[101][101] = {0};
  int i, j, n, count = 0, x1, x2, y1, y2;
  scanf("%d", &n);
  while (n--) {
    x1 = x2 = y1 = y2 = 0;
    scanf("\n%d %d %d %d", &x1, &y1, &x2, &y2);
    x1--;
    x2--;
    y1--;
    y2--;
    for (i = x1; i <= x2; i++)
      for (j = y1; j <= y2; j++) {
        tab[99 - i][j]++;
        count++;
      }
  }
  printf("%d", count);
  return 0;
}
