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