#include #include using namespace std; using ll=long long; int main(){ ll h,w,q; cin>>h>>w>>q; ll ret=h*w; map seatingch; for(int i=0;i>y>>x; if(seatingch.count(x)){ if(seatingch[x]>y){ ret+=h-seatingch[x]+1; seatingch[x]=y; ret-=h-y+1; } }else{ seatingch[x]=y; ret-=h-y+1; } cout<