w=int(input()) h=int(input()) n=int(input()) a,b=[],[] for i in range(n): x,y=map(int,input().split()) a.append(x) b.append(y) a=list(set(a)) b=list(set(b)) print(w*h-(w-len(a))*(h-len(b))-n)