#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int table[100][100] = {0}, n;
  cin >> n;
  while (n--) {
    int x, y, x1, y1;
    cin >> x >> y >> x1 >> y1;
    for (int i = x - 1; i < x1; ++i) {
      for (int j = y - 1; j < y1; ++j) {
        table[i][j]++;
      }
    }
  }
  long long int sum = 0;
  for (int i = 0; i < 100; ++i) {
    for (int j = 0; j < 100; ++j) {
      sum += table[i][j];
    }
  }
  cout << sum << endl;
  return 0;
}
