#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x1, y1, x2, y2, j, k, sum = 0;
  int a[101][101];
  memset(a, 0, sizeof(a));
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    for (k = x1; k <= x2; k++)
      for (j = y1; j <= y2; j++) a[k][j]++;
  }
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) sum += a[i][j];
  printf("%d\n", sum);
  return 0;
}
