#include <bits/stdc++.h>
using namespace std;
const int N = 50001;
int m[110][110];
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 x = x1; x <= x2; x++)
      for (int y = y1; y <= y2; y++) m[x][y]++;
  }
  int sum = 0;
  for (int i = 0; i < 101; i++)
    for (int j = 0; j < 101; j++) sum += m[i][j];
  cout << sum << endl;
  return 0;
}
