W, H, N = [int(input()) for _ in range(3)] pw = [0]*(W+1) ph = [0]*(H+1) for _ in range(N): w, h = map(int,input().split()) pw[w]=1 ph[h]=1 ws = sum(pw) hs = sum(ph) n = W*hs + ws*H - ws*hs -N print(n)