cox,coy=1,1 W=int(input()) H=int(input()) n=int(input()) out=0 w=[] h=[] for i in range(n): x,y=map(int,input().split()) a,b=0,0 for j in range(i): if w[j]==x:a=1 if h[j]==y:b=1 w.append(x) h.append(y) if a+b==2:out-=1 if a==0:out+=H-coy if b==0:out+=W-cox if a==0:cox+=1 if b==0:coy+=1 print(out)