#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 110;
int a[MAX][MAX];
int main() {
  int n, x1, y1, x2, y2;
  cin >> n;
  for (int i = 0, _n = (n); i < _n; ++i) {
    cin >> x1 >> y1 >> x2 >> y2;
    x1 = 100 - x1 + 1;
    x2 = 100 - x2 + 1;
    for (int i = x2, _n = (x1 + 1); i < _n; ++i) {
      for (int j = y1, _n = (y2 + 1); j < _n; ++j) a[i][j]++;
    }
  }
  long long int ans = 0;
  for (int i = 1, _n = (101); i < _n; ++i)
    for (int j = 1, _n = (101); j < _n; ++j) ans += a[i][j];
  cout << ans << endl;
  return 0;
}
