s[101],k[101];w,h,p,q,i,x,y,t;main(){for(scanf("%d%d%*d",&w,&h);~scanf("%d%d",&p,&q);x+=!!p,y+=!!q,s[t]=p,k[t++]=q)for(i=0;i