#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int a[111][111];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; 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;
}
