W=int(input()) H=int(input()) N=int(input()) A=set() #マーク B=set() #数字 X=0 for _ in range(N): S,K=map(int,input().split()) if S not in A: A.add(S) X+=(H-len(B)-(K not in B)) else: X-=1 if K not in B: B.add(K) X+=(W-len(A)) else: X-=1 print(X)