#include <iostream>
#include <cmath>
#define N 105
using namespace std;
int n, a[N][N], ans;
int main(){
cin>>n;
while(n--){
int x1, x2, y1, y2;
cin>>x1>>y1>>x2>>y2;
for(int i = x1; i < x2; i++){
for(int j = y1; j < y2; j++){
if(!a[i][j]){
a[i][j] = true;
// cout<<i << ' '<<j<<endl;
ans++;
}
}
}
}
cout<<ans<<endl;
return 0;
}