W=int(input()) H=int(input()) N=int(input()) s=0; m=[] n=[] for i in range(0,N): S,K=map(int,input().split()) if (S not in m) and (K not in n): H-=1 W-=1 s+=H+W elif (S in m) and (K not in n): H-=1 s+=W-1 elif (K in n) and (S not in m): W-=1 s+=H-1 else: s-=1 m.append(S) n.append(K) print(s)