#include <bits/stdc++.h>
using namespace std;
long long a[111][111];
int n, xx1, yy1, xx2, yy2;
int main() {
  cin >> n;
  while (n--) {
    cin >> xx1 >> yy1 >> xx2 >> yy2;
    for (int i = xx1; i <= xx2; i++) {
      for (int j = yy1; j <= yy2; j++) {
        a[i][j]++;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      ans += a[i][j];
    }
  }
  cout << ans << endl;
  return 0;
}
