#include using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define REP(i, a) for(int i = 0; i < a; i++) #define scan(x) cin >> x #define print(x) cout << x << "\n" typedef long long ll; int main() { fastcin; int W, H; ll N; scan(W); scan(H); scan(N); bool wl[1000001] = {}, hl[1000001] = {}; int wa = 0, ha = 0; ll ans; REP(i, N) { int s, k; cin >> s >> k; if (!wl[s]) { wa++; wl[s] = true; } else ; if (!hl[k]) { ha++; hl[k] = true; } else ; } ans = wa*H + ha*W - N - wa*ha; print(ans); return 0; }