#include <bits/stdc++.h>
using namespace std;
int data[110][110] = {};
int main() {
  int n, x, y, xx, yy;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y >> xx >> yy;
    for (int j = x; j <= xx; j++)
      for (int k = y; k <= yy; k++) data[j][k]++;
  }
  n = 0;
  for (int i = 0; i <= 100; i++)
    for (int j = 0; j <= 100; j++) n += data[i][j];
  cout << n << endl;
  return 0;
}
