#include <bits/stdc++.h>
using namespace std;
int n;
int num[1000][1000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    for (int i = x1; i <= x2; i++) {
      for (int j = y1; j <= y2; j++) {
        num[i][j]++;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      ans += num[i][j];
    }
  }
  cout << ans << endl;
}
