W = int(input()) H = int(input()) N = int(input()) SK = sorted([list(map(int, input().split())) for _ in range(N)]) S, K = zip(*SK) print(W * H - (W - len(set(S)))*(H - len(set(K))) - N)