#include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //using namespace atcoder; using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>>>; int main() { ll W, H, N; cin >> W >> H >> N; set S, K; rep(i, N) { ll s, k; cin >> s >> k; S.insert(s); K.insert(k); } cout << W * H - (W - S.size()) * (H - K.size()) - N << endl; }