#include <bits/stdc++.h>
template <class T>
inline T abs(T n) {
  return (n < 0 ? -n : n);
}
template <class T>
inline T max(T a, T b) {
  return (a > b ? a : b);
}
template <class T>
inline T min(T a, T b) {
  return (a < b ? a : b);
}
template <class T>
inline T sq(T x) {
  return x * x;
}
template <class T>
inline T sqrt(T x) {
  return (T)sqrt((double)x);
}
template <class T>
inline T gcd(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (!b) return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T>
inline T isvowel(T s) {
  s = tolower(s);
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u') return (1);
  return (0);
}
template <class T>
inline T isupper(T s) {
  if (s >= 'A' && s <= 'Z') return (1);
  return (0);
}
template <class T>
inline T getbit(T x, T i) {
  T t = 1;
  return (x & (t << i));
}
template <class T>
inline T setbit(T x, T i) {
  T t = 1;
  return (x | (t << i));
}
using namespace std;
int main() {
  long int ara[101][101] = {0};
  long int sum = 0, i, x1, x2, y1, y2;
  long int n;
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> x1 >> y1 >> x2 >> y2;
      sum += (x2 - x1 + 1) * (y2 - y1 + 1);
    }
    cout << sum << endl;
    sum = 0;
  }
  return (0);
}
