#include #include using lint = long long; void solve() { lint w, h; std::cin >> w >> h; int n; std::cin >> n; std::set xs, ys; for (int i = 0; i < n; ++i) { int x, y; std::cin >> x >> y; xs.insert(x); ys.insert(y); } std::cout << w * h - (w - xs.size()) * (h - ys.size()) - n << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }