def main(): W = int(input()) H = int(input()) N = int(input()) hands = [tuple(map(int, input().split())) for _ in range(N)] suits = set(card[0] for card in hands) numbers = set(card[1] for card in hands) match_candidate = len(suits) * H + len(numbers) * \ W - len(suits) * len(numbers) print(match_candidate - len(hands)) if __name__ == "__main__": main()