#include<iostream>
using namespace std;
int main()
{
bool a[240][240]={0};
int b=0,c=0,num=0, select=0,cnt=0,x1=0,y1=0,x2=0,y2=0;
cin >> b>>c>>num;
while (num != select)
{
select++;
cin >> x1>>y1>>x2>>y2;
for (int i = x1-1; i < x2; i++)
{
for (int j = y1-1; j < y2; j++)
{
a[i][j] = 1;
}
}
}
for (int i = 0; i < b; i++)
{
for (int j = 0; j < c; j++)
{
if (a[i][j] == 1)
{
cnt++;
}
}
cout << endl;
}
cout << endl;
cout << cnt;
}
}