#include <bits/stdc++.h>
using namespace std;
int s[111][111];
int main() {
  int n, i, j, ii, xa, xb, ya, yb;
  cin >> n;
  for (ii = 0; ii < n; ++ii) {
    cin >> xa >> ya >> xb >> yb;
    for (i = ya; i <= yb; ++i)
      for (j = xa; j <= xb; ++j) ++s[i][j];
  }
  int sum = 0;
  for (i = 1; i < 101; ++i)
    for (j = 1; j < 101; ++j) sum += s[i][j];
  cout << sum << "\n";
}
