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*W + lenn*H - lens*lenn - N