inpl = lambda: list(map(int,input().split())) W = int(input()) H = int(input()) N = int(input()) hset = set() wset = set() for _ in range(N): w, h = inpl() wset.add(w) hset.add(h) Lh = len(hset) Lw = len(wset) print(Lh*W + H*Lw - Lh*Lw - N)