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