#include #include #include #include #include #include using namespace std; int main() { int w, h, n; cin >> w >> h >> n; set used_w, used_h; int s, k; for (int i = 0; i < n; i++) { cin >> s >> k; used_w.insert(s); used_h.insert(k); } long long total = (long long) w * h - (w - used_w.size()) * (h - used_h.size()) - n; cout << total << endl; return 0; }