#include <bits/stdc++.h>
using namespace std;
int arr[100][100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int j = x1 - 1; j < x2; j++) {
      for (int k = y1 - 1; k < y2; k++) arr[j][k]++;
    }
  }
  int ans = 0;
  for (int i = 0; i < 100; i++)
    for (int j = 0; j < 100; j++) ans += arr[i][j];
  cout << ans;
}
