w = int(input()) h = int(input()) n = int(input()) cards = [0 for _ in range(n)] A = set() B = set() for i in range(n): s, k = map(int, input().split()) A.add(s) B.add(k) print(w * h - (w - len(A)) * (h - len(B)) - n)