def ni():return int(input()) w = ni() h = ni() n = ni() s = set() k = set() for i in range(n): st, kt = map(int, input().split()) s.add(st) k.add(kt) print(len(s)*h+len(k)*w-len(s)*len(k)-n)