#include <bits/stdc++.h>
using namespace std;
int a[110][110];
int main() {
  int t;
  for (int h = 0; h < 100000; h++) {
    int hescape = 125;
  }
  for (int h = 0; h < 100000; h++) {
    int hescape = 125;
  }
  cin >> t;
  while (t--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int i = x1; i <= x2; i++)
      for (int j = y1; j <= y2; j++) a[i][j]++;
  }
  for (int h = 0; h < 100000; h++) {
    int hescape = 125;
  }
  long long sum = 0;
  for (int i = 1; i < 101; i++)
    for (int j = 1; j < 101; j++) sum += a[i][j];
  cout << sum << endl;
  return 0;
}
