W = int(input()) H = int(input()) N = int(input()) S = set() K = set() for i in range(N): s, k = map(int,input().split()) S.add(s) K.add(k) CW = len(S) CH = len(K) print(W*H-(W-CW)*(H-CH)-N)