#include // #include using namespace std; // using namespace atcoder; using lint = long long; #define endl '\n' lint const mod = 1e9+7; //long const mod = 998244353; lint h,w,q; lint y[100000]; lint x[100000]; unordered_mapmapp; int main(){ cin >> h >> w >> q; for(int i=0;i> y[i] >> x[i]; if(mapp[x[i]] == 0){ mapp[x[i]] = y[i]; }else{ mapp[x[i]] = min(mapp[x[i]], y[i]); } lint ans = 0; ans += (w - mapp.size()) * h; for(auto p : mapp){ ans += p.second - 1; } cout << ans << endl; } }