H, W, Q = map(int,input().split()) y = [None]*Q x = [None]*Q for i in range(Q): y[i], x[i] = map(int,input().split()) #列の最大の行番号を記録する D = {} ans = H*W for i in range(Q): if not x[i] in D: D[x[i]] = y[i] ans -= H-y[i]+1 else: if D[x[i]] > y[i]: ans -= D[x[i]] - y[i] D.pop(x[i]) D[x[i]] = y[i] print(ans)