#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101][101], i, j, x1, y1, x2, y2, s;
  cin >> n;
  for (i = 1; i <= 100; i++) {
    for (j = 1; j <= 100; j++) {
      a[i][j] = 0;
    }
  }
  s = 0;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (i = y1; i <= y2; i++) {
      for (j = x1; j <= x2; j++) {
        a[i][j]++;
      }
    }
  }
  for (i = 1; i <= 100; i++) {
    for (j = 1; j <= 100; j++) {
      s = s + a[i][j];
    }
  }
  cout << s << endl;
  return 0;
}
