from collections import defaultdict dic = defaultdict(int) H,W,Q = map(int,input().split()) NC = 0 HW = H * W for _ in range(Q): Y,X = map(int,input().split()) ny = H - Y + 1 now = dic[X] if now < ny: NC += ny - now dic[X] = ny print(HW - NC)