#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, i = 0;
  cin >> n;
  t = n;
  int x1[101], y1[101], x2[101], y2[101], c[101][101] = {0};
  while (t--) {
    cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
    i++;
  }
  for (int j = 1; j < 101; j++) {
    for (int i = 1; i < 101; i++) {
      for (int k = 0; k < n; k++) {
        if ((i >= x1[k] && i <= x2[k]) && (j >= y1[k] && j <= y2[k])) c[j][i]++;
      }
    }
  }
  int sum = 0;
  for (int i = 1; i < 101; i++) {
    for (int j = 1; j < 101; j++) {
      sum += c[i][j];
    }
  }
  cout << sum << endl;
  return 0;
}
