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