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