#include <bits/stdc++.h>
using namespace std;
void NextStep(int, int, int, int);
int Matrix[101][101];
int main() {
  int n, x1, x2, y1, y2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x1;
    cin >> y1;
    cin >> x2;
    cin >> y2;
    NextStep(x1, y1, x2, y2);
  }
  int S = 0;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) S += Matrix[i][j];
  }
  cout << S << endl;
  return 0;
}
void NextStep(int x1, int y1, int x2, int y2) {
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) Matrix[i][j]++;
  }
}
