W = int(input())
H = int(input())
N = int(input())
L = [list(map(int,input().split())) for _ in range(N)]
S,K = [set(i) for i in zip(*L)]
ans = (len(S) * H) + (len(K) * (W - len(S))) - N
print(ans)