#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 256;
const char nxt = '\n';
inline void in(string Q) {
  Q += ".in";
  freopen(Q.c_str(), "r", stdin);
}
inline void out(string Q) {
  Q += ".out";
  freopen(Q.c_str(), "w", stdout);
}
inline void open_file(string Q) {
  in(Q);
  out(Q);
}
int n, a[111][111];
int main() {
  if (0) open_file("");
  scanf("%d", &n);
  while (n--) {
    int x, y, X, Y;
    scanf("%d", &x);
    scanf("%d", &y);
    scanf("%d", &X);
    scanf("%d", &Y);
    for (int i = x; i <= X; ++i) {
      for (int j = y; j <= Y; ++j) {
        a[i][j]++;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 100; ++j) {
      ans += a[i][j];
    }
  }
  cout << ans;
  return 0;
}
