#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 5 + 3e5;
const int INF = 1e9;
int x[105][105];
int main() {
  int n, ans = 0;
  cin >> n;
  while (n--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    for (int i = a; i <= c; ++i)
      for (int j = b; j <= d; ++j) x[i][j]++;
  }
  for (int i = 1; i <= 100; ++i)
    for (int j = 1; j <= 100; ++j) ans += x[i][j];
  cout << ans;
}
