w=int(input()) h=int(input()) n=int(input()) SK=[list(map(int,input().split())) for _ in range(n)] SK.sort() wsum,hsum=1,1 for i in range(1,n): if SK[i-1][0]!=SK[i][0]: wsum+=1 if SK[i-1][1]!=SK[i][1]: hsum+=1 print((w*h) - (w-wsum)*(h-hsum) - n)