def main(): import sys input = sys.stdin.readline W = int(input()) H = int(input()) N = int(input()) SK = [list(map(int,input().split())) for _ in range(N)] d1 = set() d2 = set() s = set() for i in range(N): S,K = SK[i] s.add((S,K)) d1.add(S) d2.add(K) count = 0 count += (H-len(d2))*len(d1) count += (W-len(d1))*len(d2) for i in d1: for j in d2: if not (i,j) in s: count += 1 print(count) if __name__ == '__main__': main()