#include <bits/stdc++.h>
using namespace std;
int n, grid[105][105];
int main() {
  cin >> n;
  int x1, x2, y1, y2;
  for (int i = 0; i < n; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    for (int x = x1; x <= x2; x++)
      for (int y = y1; y <= y2; y++) grid[x][y]++;
  }
  int total = 0;
  for (int x = 0; x <= 100; x++)
    for (int y = 0; y <= 100; y++) total += grid[x][y];
  cout << total << endl;
}
