from collections import defaultdict h, w, q = map(int, input().split()) d = defaultdict(lambda: 10**18) res = h*w for i in range(q): y, x = map(int, input().split()) if y < d[x]: if d[x] == 10**18: d[x] = y res -= h-d[x]+1 else: res -= d[x]-y d[x] = y print(res)