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