#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { int W, H, N; cin >> W >> H >> N; map m; set s; for (int i = 0; i < N; i++) { int S, K; cin >> S >> K; m[S]++; s.insert(K); } ll ans = 0; for (int j = 1; j <= W; j++) if (m.count(j)) ans += H - m[j]; else ans += s.size(); cout << ans << endl; }