w = int(input()) h = int(input()) n = int(input()) L = [tuple(map(int,input().split())) for i in range(n)] sW = set() sH = set() for x,y in L: sW.add(x) sH.add(y) ans = h*w ans -= len(sW)*h+len(sH)*w-len(sW)*len(sH) print(h*w-ans-n)