h,w,q = map(int,input().split()) dic = {} ans = h*w for i in range(q): y,x = map(int,input().split()) if x in dic: if y < dic[x]: ans -= dic[x]-y dic[x] = y else: ans -= h+1-y dic[x] = y print(ans)