#include <bits/stdc++.h>
using namespace std;
int grid[110][110];
int main() {
  int x1, y1, x2, y2, ans = 0;
  int n;
  cin >> n;
  for (int i = 1; i <= n + 1; i++) {
    for (int j = 1; j <= n + 1; j++) grid[i][j] = 0;
  }
  int k = n;
  while (k--) {
    cin >> y1 >> x1 >> y2 >> x2;
    for (int i = x1; i <= x2; i++)
      for (int j = y1; j <= y2; j++) grid[i][j]++;
  }
  for (int i = 1; i <= 102; i++) {
    for (int j = 1; j <= 102; j++) ans += grid[i][j];
  }
  cout << ans << endl;
  return 0;
}
