#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; ll w, h, n; cin >> w >> h >> n; ll ts[n], tk[n]; for (ll i = 0; i < n; ++i) cin >> ts[i] >> tk[i]; ll wline = 0, hline = 0; ll ans = 0; for (ll i = 0; i < n; ++i) { bool whit = false, hhit = false; for (ll j = 0; j < i; ++j) { if (ts[i] == ts[j]) whit = true; if (tk[i] == tk[j]) hhit = true; } if (!whit && !hhit) { wline++; hline++; ans += (w-wline) + (h-hline); } else if (!whit) { wline++; ans += (h-hline); ans--; } else if (!hhit) { hline++; ans += (w-wline); ans--; } else { ans--; } } cout << ans << endl; return 0; }