W = int(input()) H = int(input()) N = int(input()) S = set() K = set() for _ in range(N): s,k = map(int,input().split()) S.add(s) K.add(k) ans = len(S)*H+len(K)*W-2*N-(len(S)*len(K)-N) print(ans)