#include <bits/stdc++.h>   using namespace std;   int n, a, b, c, d, s = 0, i;   int main() {     cin >> n;     for (i = 1; i <= n; i++) {       cin >> a >> b >> c >> d;       s = s + (c - a + 1) * (d - b + 1);     }     cout << s;   }   