#include <bits/stdc++.h>
using namespace std;
int n;
int x1, qwerty, x2, y2;
long long arr[111][111];
int main() {
  long long sum = 0;
  scanf("%d", &n);
  for (int(i) = (0); (i) < int(n); ++(i)) {
    scanf("%d %d %d %d", &x1, &qwerty, &x2, &y2);
    for (int(j) = (x1); (j) < int(x2 + 1); ++(j)) {
      for (int(k) = (qwerty); (k) < int(y2 + 1); ++(k)) {
        arr[j][k]++;
      }
    }
  }
  for (int(i) = (1); (i) < int(101); ++(i)) {
    for (int(j) = (1); (j) < int(101); ++(j)) {
      sum += arr[i][j];
    }
  }
  printf("%I64d\n", sum);
  cin.sync();
  cin.get();
  return 0;
}
