H, W, Q = map(int, input().split()) col = [H] * W cur = H * W for _ in range(Q): Y, X = (int(x) - 1 for x in input().split()) if col[X] > Y: cur -= col[X] - Y col[X] = Y print(cur)