W = int(input()) H = int(input()) N = int(input()) SK = [list(map(int, input().split())) for _ in range(N)] num_s = len(set([x for x,_ in SK])) num_k = len(set([x for _,x in SK])) print(num_s * H + (W - num_s) * num_k - N)