#include <bits/stdc++.h>
using namespace std;
unsigned long long numero, soma = 0;
;
int table[200][200];
int tabela_auxiliar[200][8];
int main() {
  memset(table, 0, sizeof table);
  cin >> numero;
  for (int i = 0; i < (int)numero; i++) {
    for (int k = 0; k < 4; k++) {
      cin >> tabela_auxiliar[i][k];
      tabela_auxiliar[i][k]--;
    }
  }
  for (int k = 0; k < (int)numero; k++) {
    for (int i = tabela_auxiliar[k][0]; i <= tabela_auxiliar[k][2]; i++) {
      for (int j = tabela_auxiliar[k][1]; j <= tabela_auxiliar[k][3]; j++) {
        table[i][j] += 1;
      }
    }
  }
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
      soma += table[i][j];
    }
  }
  cout << soma << "\n";
}
