#include #define debug(x) cerr << #x << ": " << x << endl #define debugArray(x, n) \ for (long long hoge = 0; (hoge) < (n); ++(hoge)) \ cerr << #x << "[" << hoge << "]: " << x[hoge] << endl using namespace std; signed main() { cin.tie(0); ios::sync_with_stdio(false); long long W, H, N; cin >> W >> H >> N; set Sw, Sh; for (int i = 0; i < N; i++) { int S, K; cin >> S >> K; Sw.insert(S); Sh.insert(K); } cout << W * H - (W - Sw.size()) * (H - Sh.size()) - N << endl; return 0; }