W,H,N = int(raw_input()),int(raw_input()),int(raw_input())
S,K = [0 for i in range(N)],[0 for i in range(N)]
for i in range(N):
	S[i],K[i] = map(int,raw_input().split())
S,K = set(S),set(K)
ans = W * H - (W - len(S)) * (H - len(K))
ans -= N
print ans