import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline w = int(input()) h = int(input()) n = int(input()) S = set() K = set() for i in range(n): s, k = map(int, input().split()) S.add(s) K.add(k) a = len(S) b = len(K) ans = h*w-(w-a)*(h-b)-n print(ans)