from collections import defaultdict H, W, Q = map(int, input().split()) A = defaultdict(lambda: float('inf')) ans = H * W for _ in range(Q): Y, X = map(int, input().split()) A[X] = min(A[X], Y) m = W - len(A.keys()) ans = H * m for k, v in A.items(): ans += v - 1 print(ans)