# 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(W * H - (W - A) * (H - B) - N)