W = int(input()) H = int(input()) N = int(input()) l = [[] for i in range(W)] s = set([]) for i in range(N): mark, num = map(int, input().split()) l[mark - 1].append(num) s.add(num) s_len = len(s) ans = 0 for l_i in l: if len(l_i) == 0: ans += s_len else: ans += H - len(l_i) print(ans)