W = int(input()) H = int(input()) N = int(input()) lssk = [list(map(int,input().split())) for i in range(N)] lsW = [False]*(W+1) lsH = [False]*(H+1) for i in range(N): w,h = lssk[i][0],lssk[i][1] lsW[w] = True lsH[h] = True print(lsW.count(True)*H+lsH.count(True)*W-lsW.count(True)*lsH.count(True)-N)