#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { ll w, h; cin >> w >> h; int n; cin >> n; set x, y; rep(_, n) { int a, b; cin >> a >> b; x.insert(a); y.insert(b); } ll ans = w * h - (w - x.size()) * (h - y.size()) - n; cout << ans << endl; return 0; }