#include <bits/stdc++.h>
using namespace std;
long l[101][101], n, i, j;
int main() {
  cin >> n;
  int x1, y1, x2, y2;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (i = x1; i <= x2; i++)
      for (j = y1; j <= y2; j++) l[i][j]++;
  }
  long long res = 0;
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) res += l[i][j];
  cout << res;
}
