# Input W = int(input()) H = int(input()) N = int(input()) S = [ None ] * N K = [ None ] * N for i in range(N): S[i], K[i] = map(int, input().split()) # Calculation A = len(set(S)) B = len(set(K)) print(H * W - (H - A) * (W - B) - N)