#include #include #include #include using namespace std; using ll = long long; const int INF = 100100100; int main(){ int h , w , q; cin >> h >> w >> q; map mp; ll now = (ll)h * w; while(q--){ int y , x; cin >> y >> x; if(mp[x] == 0){ now -= (h - y + 1); mp[x] = y; }else{ if(mp[x] <= y){ }else{ now -=(mp[x] - y); mp[x] = y; } } cout << now << endl; } return 0; }