#include #include #include using namespace std; template vector uni(vector v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); return v; } int main() { long long w, h, n; cin >> w >> h >> n; vector s(n), k(n); for (int i = 0; i < n; i++) cin >> s[i] >> k[i]; long long cnt_s = uni(s).size(); long long cnt_k = uni(k).size(); long long match = cnt_s * h + w * cnt_k - cnt_s * cnt_k; cout << match - n << endl; return 0; }