#include <bits/stdc++.h>
const int maxn = 100 + 5;
using namespace std;
int val[maxn][maxn];
void doit(int x1, int y1, int x2, int y2) {
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      val[i][j]++;
    }
  }
}
int main() {
  memset(val, 0, sizeof(val));
  int n;
  cin >> n;
  while (n--) {
    int x, y, u, v;
    cin >> x >> y >> u >> v;
    doit(x, y, u, v);
  }
  int sum = 0;
  for (int i = 1; i <= 100; i++)
    for (int j = 1; j <= 100; j++) sum += val[i][j];
  cout << sum << endl;
  return 0;
}
