w = int(input()) h = int(input()) n = int(input()) wc , hc = 0 , 0 wl = [0] * (w + 1) hl = [0] * (h + 1) for i in range(n): s,k = map(int,input().split()) if wl[s] == 0: wl[s] = 1 if hl[k] == 0: hl[k] = 1 ws , hs = sum(wl) , sum(hl) print(h * ws + w * hs - ws * hs - n)