#include <bits/stdc++.h>
using namespace std;
int getDig(char ch) {
  int a = 0;
  if (ch == '1') {
    a = 1;
  } else if (ch == '2') {
    a = 2;
  } else if (ch == '3') {
    a = 3;
  } else if (ch == '4') {
    a = 4;
  } else if (ch == '5') {
    a = 5;
  } else if (ch == '6') {
    a = 6;
  } else if (ch == '7') {
    a = 7;
  } else if (ch == '8') {
    a = 8;
  } else if (ch == '9') {
    a = 9;
  } else {
    a = 0;
  }
  return a;
}
void QuickSort(int a, int b, vector<vector<int> >& v1, vector<int>& v2) {
  int i, j, mode;
  if (a >= b) return;
  for (i = a, j = b, mode = 1; i<j; mode> 0 ? j-- : i++) {
    if (v1[i].size() > v1[j].size()) {
      vector<int> t = v1[j];
      v1[j] = v1[i];
      v1[i] = t;
      int v = v2[j];
      v2[j] = v2[i];
      v2[i] = v;
      mode = -mode;
    }
  }
  QuickSort(a, i - 1, v1, v2);
  QuickSort(i + 1, b, v1, v2);
}
int main() {
  int size = 100;
  vector<vector<int> > vec(size + 1);
  for (int i = 1; i <= size; i++) {
    vector<int> v(size + 1);
    vec[i] = v;
  }
  int n = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int j = x1; j <= x2; j++) {
      for (int p = y1; p <= y2; p++) {
        vec[j][p]++;
      }
    }
  }
  int res = 0;
  for (int i = 1; i <= size; i++) {
    for (int j = 1; j <= size; j++) {
      res += vec[i][j];
    }
  }
  cout << res << endl;
  return 0;
}
