#include <bits/stdc++.h>
using ll = long long;
int main() {
  int m{101};
  std::vector<std::vector<int>> v(m, std::vector<int>(m));
  int n, a_col, a_row, b_col, b_row;
  std::cin >> n;
  while (n--) {
    std::cin >> a_col >> a_row >> b_col >> b_row;
    for (int i{m - a_row}, sx{m - b_row}; sx <= i; --i) {
      for (int j{a_col}; j <= b_col; ++j) {
        v[i][j] += 1;
      }
    }
  }
  int sum{};
  for (int i{}; i < m; ++i) {
    for (int j{}; j < m; ++j) {
      sum += v[i][j];
    }
  }
  std::cout << sum << std::endl;
}
