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