#include <bits/stdc++.h>
using namespace std;
int ar[200][200];
int main() {
  ios ::sync_with_stdio(0);
  int n;
  cin >> n;
  while (n--) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; j++) ar[i][j]++;
    }
  }
  long long int ans = 0;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) ans += ar[i][j];
  }
  cout << ans << endl;
  return 0;
}
