#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
int mat[MAX + 10][MAX + 10];
int main() {
  int n;
  cin >> n;
  int x1, x2, y1, y2;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (int j = x1; j <= x2; j++)
      for (int k = y1; k <= y2; k++) mat[j][k]++;
  }
  int res = 0;
  for (int i = 1; i <= 100; i++)
    for (int j = 1; j <= 100; j++) res += mat[i][j];
  cout << res << endl;
}
