w = int(input()) h = int(input()) n = int(input()) havew = [False] * w haveh = [False] * h for _ in range(n): s, k = map(int, input().split()) havew[s-1] = True haveh[k-1] = True sw = sum(havew) sh = sum(haveh) ans = sw * h + sh * w - sw * sh - n print(ans)