#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int a[105][105], i, j, n, x1, y1, x2, y2, ans = 0;
  cin >> n;
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) a[i][j] = 0;
  for (int q = 0; q < n; q++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (i = x1; i <= x2; i++)
      for (j = y1; j <= y2; j++) a[i][j]++;
  }
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) ans += a[i][j];
  cout << ans;
}
