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