#include <bits/stdc++.h>
using namespace std;
int s[110][110];
struct poin {
  int x1;
  int y1;
  int x2;
  int y2;
};
vector<struct poin> v;
int main() {
  int a, b, c, d, e, f, n, x1, y1, x2, y2;
  while (cin >> n) {
    v.clear();
    memset(s, 0, sizeof(s));
    for (c = 0; c < n; c++) {
      cin >> x1 >> y1 >> x2 >> y2;
      struct poin A;
      A.x1 = x1;
      A.y1 = y1;
      A.x2 = x2;
      A.y2 = y2;
      v.push_back(A);
    }
    for (c = 0; c < v.size(); c++) {
      for (d = v[c].x1; d <= v[c].x2; d++) {
        for (e = v[c].y1; e <= v[c].y2; e++) {
          s[d][e]++;
        }
      }
    }
    int ans = 0;
    for (c = 0; c < 101; c++) {
      for (d = 0; d < 101; d++) {
        ans += s[c][d];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
