w = int(input()) h = int(input()) n = int(input()) W = set() H = set() ans = 0 for _ in range(n): s, k = map(int, input().split()) W.add(s) H.add(k) ans = h * w - (h - len(H)) * (w - len(W)) - n print(ans)