from collections import defaultdict W = int(input()) H = int(input()) N = int(input()) SK = [list(map(int, input().split())) for _ in range(N)] d = defaultdict(list) for k, v in SK: d[k].append(v) mm = 0 b = set() for dv in d.values(): mm += H - len(dv) for dvv in dv: b.add(dvv) h = len(list(d.keys())) mn = (W - h) * len(b) print(mm + mn)