#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  vector<vector<int> > tab(105, vector<int>(105, 0));
  int n;
  cin >> n;
  for (long long i = 0; i < (int)n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int j = y2; j >= y1; --j) {
      for (int k = x1; k <= x2; ++k) {
        tab[j][k]++;
      }
    }
  }
  int sum = 0;
  for (long long i = 0; i < (int)105; i++) {
    for (long long j = 0; j < (int)105; j++) {
      sum += tab[i][j];
    }
  }
  cout << sum << endl;
  return 0;
}
