#include using namespace std; using i64 = long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); auto solve = [&]() { int w, h, n; cin >> w >> h >> n; set x, y; for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; x.insert(a), y.insert(b); } i64 ans = 1LL * w * h - 1LL * (w - x.size()) * (h - y.size()) - n; cout << ans << '\n'; }; solve(); return 0; }