from collections import defaultdict import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) H, W, Q = map(int, input().split()) row = defaultdict(int) ans = H * W for _ in range(Q): h, w = map(int, input().split()) if not row[w]: ans -= H - h + 1 row[w] = h else: if row[w] > h: ans -= row[w] - h row[w] = h print(ans)