#include #include using namespace std; typedef long long ll; ll w, h, n; ll s[100], k[100]; bool flgS[1000002], flgK[1000002]; int main(){ while(cin >> w >> h >> n){ memset(flgS, 0, sizeof(flgS)); memset(flgK, 0, sizeof(flgK)); ll kcnt = 0; for(ll i = 0; i < n; i++){ cin >> s[i] >> k[i]; if(!flgK[k[i]]) kcnt++; flgS[s[i]] = true; flgK[k[i]] = true; } ll ans = -n; for(ll i = 1; i <= w; i++){ if(flgS[i]){ ans += h; } else{ ans += kcnt; } } cout << ans << endl; } }