w = int(input()) h = int(input()) n = int(input()) s1 = set() s2 = set() for i in range(n): s,k = map(int,input().split()) s1.add(s) s2.add(k) a,b = len(s1),len(s2) print(a*h+b*w-a*b-n)