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