from collections import defaultdict w = int(input()) h = int(input()) n = int(input()) mark = defaultdict(int) mark_set = set() num = defaultdict(int) num_set = set() ans = 0 for i in range(n): s, k = map(int, input().split()) mark[s] += 1 num[k] += 1 mark_set.add(s) num_set.add(k) ans += (len(mark_set) * h) + (len(num_set) * w ) - (len(mark_set) * len(num_set)) - n print(ans)