#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[101][101];
  int n;
  int i, j, k;
  memset(arr, 0, sizeof(arr));
  cin >> n;
  int x1, x2, y1, y2;
  for (i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (j = x1; j <= x2; j++) {
      for (k = y1; k <= y2; k++) {
        arr[101 - j][k]++;
      }
    }
  }
  int sum = 0;
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= 100; j++) sum += arr[i][j];
  cout << sum << "\n";
  return 0;
}
