H,W,Q = map(int,input().split()) A = [H+1]*(W+1) tot = H*W for _ in range(Q): y,x = map(int,input().split()) if A[x]