#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long arr[100][100] = {0};
  cin >> n;
  long long x1[n], y1[n], y2[n], x2[n];
  for (long long lv = 0; lv < n; lv++) {
    cin >> x1[lv] >> y1[lv] >> x2[lv] >> y2[lv];
    x1[lv]--;
    x2[lv]--;
    y1[lv]--;
    y2[lv]--;
  }
  long long ans = 0;
  for (long long lv = 0; lv < 100; lv++) {
    for (long long lv2 = 0; lv2 < 100; lv2++) {
      for (long long lv3 = 0; lv3 < n; lv3++) {
        if (lv >= x1[lv3] && lv <= x2[lv3] && lv2 >= y1[lv3] &&
            lv2 <= y2[lv3]) {
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
