#include <bits/stdc++.h>
using namespace std;
int a[101][101];
int main() {
  int n, x1, y1, x2, y2, i, j, s = 0;
  cin >> n;
  while (n--) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (i = y1; i <= y2; ++i)
      for (j = x1; j <= x2; ++j) ++a[i][j];
  }
  ios::sync_with_stdio(false);
  for (i = 1; i <= 100; ++i)
    for (j = 1; j <= 100; ++j) s += a[i][j];
  cout << s << '\n';
  return 0;
}
