#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  std::ios::sync_with_stdio(false);
  int arr[100][100];
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
      arr[i][j] = 0;
    }
  }
  int n;
  cin >> n;
  while (n--) {
    int y1, x1, y2, x2;
    cin >> y1 >> x1 >> y2 >> x2;
    x1--;
    y1--;
    x2--;
    y2--;
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; j++) {
        arr[i][j] = arr[i][j] + 1;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
      ans += arr[i][j];
    }
  }
  cout << ans << '\n';
}
