#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long x1, x2, y1, y2;
  long long a[110][110], sum = 0;
  cin >> n;
  for (long long k = 0; k < n; k++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (long long i = x1; i <= x2; i++) {
      for (long long j = y1; j <= y2; j++) {
        a[i][j]++;
      }
    }
  }
  for (long long i = 1; i <= 100; i++) {
    for (long long j = 1; j <= 100; j++) {
      sum += a[i][j];
    }
  }
  cout << sum << "\n";
}
