import collections H,W,Q = map(int,input().split()) lsQ = [] for i in range(Q): lsQ.append(map(int,input().split())) d = collections.defaultdict(lambda : H+1) ans = H*W for i in range(Q): Y,X = lsQ[i] if d[X] < Y: pass else: ans -= d[X]-Y d[X] = Y print(ans)