W = int(raw_input())
H = int(raw_input())
N = int(raw_input())
suits = set()
numbers = set()
for i in range(N):
	s, n = map(int,raw_input().split())
	suits.add(s)
	numbers.add(n)
lens = len(suits)
lenn = len(numbers)
print lens*H + lenn*W - lens*lenn - N