#include <bits/stdc++.h>
using namespace std;
int a[200][200], n, res;
int main() {
  cin >> n;
  int x1, y1, x2, y2;
  for (int i = 1; i <= n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (int p = x1; p <= x2; p++)
      for (int q = y1; q <= y2; q++) a[p][q]++;
  }
  for (int i = 1; i <= 100; i++)
    for (int j = 1; j <= 100; j++) res += a[i][j];
  cout << res;
  return 0;
}
