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