#yuki1338 H, W, Q = map(int, input().split()) dic = {} res = H*W for i in range(Q): y, x = map(int, input().split()) y -= 1; x -= 1 d = dic.get(x, H) if d > y: res-= (d-y) dic[x] = y print(res)