#include <iostream>
using namespace std;
const int N = 110;
bool m[N][N];
int main() {
int T;
cin >> T;
int a,b,c,d;
while (T--) {
cin >> a >> b >> c >> d;
for (int i = a; i < c; ++i) {
for (int j = b; j < d; ++j) {
m[i][j] = true;
}
}
}
int res = 0;
for (int i=0; i< N; ++i) {
for (int j = 0; j < N; ++j) {
res += m[i][j];
}
}
cout << res << endl;
return 0;
}