height, width, queries = map(int, input().split()) fronts = { } available = height * width for i in range(queries): row, col = map(int, input().split()) last = fronts.get(col, height + 1) if row < last: available -= last - row fronts[col] = row print(available)