#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n, x, y, x1, y1;
  scanf("%d", &n);
  ;
  int a[101][101] = {};
  for (long long i = 1; i < 100 + 1; i++)
    for (long long j = 1; j < 100 + 1; j++) a[i][j] = 0;
  for (long long h = 0; h < n; h++) {
    scanf("%d%d", &x, &y);
    ;
    scanf("%d%d", &x1, &y1);
    ;
    for (long long i = x; i < x1 + 1; i++)
      for (long long j = y; j < y1 + 1; j++) a[i][j]++;
  }
  int ans = 0;
  for (long long i = 1; i < 100 + 1; i++)
    for (long long j = 1; j < 100 + 1; j++) ans = ans + a[i][j];
  cout << ans << "\n";
  return 0;
}
