import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) W,H,N = I(),I(),I() mark = set() number = set() for _ in range(N): S,K = MI() mark.add(S) number.add(K) X,Y = len(mark),len(number) ans = X*H+Y*W-X*Y-N print(ans)