#include #include #include #include #include int main() { intmax_t W, H, N; scanf("%jd %jd %jd", &W, &H, &N); std::set w, h; for (int i = 0; i < N; ++i) { int wi, hi; scanf("%d %d", &wi, &hi); w.insert(wi); h.insert(hi); } intmax_t w0 = w.size(); intmax_t h0 = h.size(); intmax_t res = 0; res += h0 * W; res += H * w0; res -= h0 * w0; res -= N; printf("%jd\n", res); }