# your code goes here W=int(input()) H=int(input()) N=int(input()) S=[[int(i) for i in input ().split()] for i in range (N)] T=[0]*W L=[0]*H for i in range (N): # print (S) T[S[i][0]]+=1 L[S[i][1]]+=1 C=0 for i in range (W): # print (T) if T[i]>0: C+=H-T[i] for i in range (H): if L[i]>0: C+=W-L[i] print (C)