#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int rectangles[100][4];
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> rectangles[i][0] >> rectangles[i][1] >> rectangles[i][2] >>
        rectangles[i][3];
  int sum = 0;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      for (int k = 0; k < n; k++) {
        if (i >= rectangles[k][1] && i <= rectangles[k][3] &&
            j >= rectangles[k][0] && j <= rectangles[k][2])
          sum++;
      }
    }
  }
  cout << sum;
}
