#include using namespace std; const int N=1000000; long long w,h,ans; int n,a,b,ww[N+10],hh[N+10],wc,hc; int main(){ cin>>w>>h; cin>>n; memset(ww,0,sizeof(ww)); memset(hh,0,sizeof(hh)); for(int i=0;i>a>>b; ww[a]=hh[b]=1; } wc=hc=0; for(int i=0;i