W = int(input()) H = int(input()) N = int(input()) cnt = [0]*W s = set() for _ in range(N): Si, Ki = map(int, input().split()) Si -= 1 cnt[Si] += 1 s.add(Ki) ans = 0 for c in cnt: if c==0: ans += len(s) else: ans += H-c print(ans)