#include <bits/stdc++.h>
using namespace std;
int ro[110][110];
int main() {
  int n, x1, y1, x2, y2;
  cin >> n;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; j++) {
        ro[i][j]++;
      }
    }
  }
  int sum = 0;
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      sum = sum + ro[i][j];
    }
  }
  cout << sum;
  return 0;
}
