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