#include <bits/stdc++.h>
using namespace std;
int a[101][101];
int main() {
  int n;
  int x1, x2, y1, y2;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; j++) {
        a[i][j]++;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) ans += a[i][j];
  }
  cout << ans << endl;
  return 0;
}
