#include <bits/stdc++.h>
#define fi first
#define se second
#define all(v) v.begin() , v.end()
#define sz(v) int(v.size())
#define unq(v) sort(all(v)); v.resize(unique(all(v)) - v.begin());
using namespace std;
typedef long long ll;
typedef pair<int , int> ii;
typedef pair<long long , int> lli;
const int maxN = int(2e5)+7;
void solve(){
int n , m , k;
cin >> n >> m >> k;
ll ans = (n + m);
for (int i = 1 ; i <= k ; i++){
int x , y , u , v;
cin >> x >> y >> u >> v;
ans += 1ll * (abs(x - u) + abs(y - v));
}
cout << ans - 2ll * (k + 1) << "\n";
}
#define name "F"
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if (fopen(name".INP" , "r")){
freopen(name".INP" , "r" , stdin);
freopen(name".OUT" , "w" , stdout);
}
int t = 1; //cin >> t;
while (t--) solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgZmkgZmlyc3QKI2RlZmluZSBzZSBzZWNvbmQKI2RlZmluZSBhbGwodikgdi5iZWdpbigpICwgdi5lbmQoKQojZGVmaW5lIHN6KHYpIGludCh2LnNpemUoKSkKI2RlZmluZSB1bnEodikgc29ydChhbGwodikpOyB2LnJlc2l6ZSh1bmlxdWUoYWxsKHYpKSAtIHYuYmVnaW4oKSk7CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKdHlwZWRlZiBwYWlyPGludCAsIGludD4gaWk7CnR5cGVkZWYgcGFpcjxsb25nIGxvbmcgLCBpbnQ+IGxsaTsKCmNvbnN0IGludCBtYXhOID0gaW50KDJlNSkrNzsKCnZvaWQgc29sdmUoKXsKICAgIGludCBuICwgbSAsIGs7CiAgICBjaW4gPj4gbiA+PiBtID4+IGs7CiAgICBsbCBhbnMgPSAobiArIG0pOwogICAgZm9yIChpbnQgaSA9IDEgOyBpIDw9IGsgOyBpKyspewogICAgICAgIGludCB4ICwgeSAsIHUgLCB2OwogICAgICAgIGNpbiA+PiB4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